(x / a)^2 + (y / b)^2 + (z / c)^2 = 1
. Primarily used\n * by Cesium to represent the shape of planetary bodies.\n *\n * Rather than constructing this object directly, one of the provided\n * constants is normally used.\n * @alias Ellipsoid\n * @constructor\n *\n * @param {number} [x=0] The radius in the x direction.\n * @param {number} [y=0] The radius in the y direction.\n * @param {number} [z=0] The radius in the z direction.\n *\n * @exception {DeveloperError} All radii components must be greater than or equal to zero.\n *\n * @see Ellipsoid.fromCartesian3\n * @see Ellipsoid.WGS84\n * @see Ellipsoid.UNIT_SPHERE\n */\nfunction Ellipsoid(x, y, z) {\n this._radii = undefined;\n this._radiiSquared = undefined;\n this._radiiToTheFourth = undefined;\n this._oneOverRadii = undefined;\n this._oneOverRadiiSquared = undefined;\n this._minimumRadius = undefined;\n this._maximumRadius = undefined;\n this._centerToleranceSquared = undefined;\n this._squaredXOverSquaredZ = undefined;\n\n initialize(this, x, y, z);\n}\n\nObject.defineProperties(Ellipsoid.prototype, {\n /**\n * Gets the radii of the ellipsoid.\n * @memberof Ellipsoid.prototype\n * @type {Cartesian3}\n * @readonly\n */\n radii: {\n get: function () {\n return this._radii;\n },\n },\n /**\n * Gets the squared radii of the ellipsoid.\n * @memberof Ellipsoid.prototype\n * @type {Cartesian3}\n * @readonly\n */\n radiiSquared: {\n get: function () {\n return this._radiiSquared;\n },\n },\n /**\n * Gets the radii of the ellipsoid raise to the fourth power.\n * @memberof Ellipsoid.prototype\n * @type {Cartesian3}\n * @readonly\n */\n radiiToTheFourth: {\n get: function () {\n return this._radiiToTheFourth;\n },\n },\n /**\n * Gets one over the radii of the ellipsoid.\n * @memberof Ellipsoid.prototype\n * @type {Cartesian3}\n * @readonly\n */\n oneOverRadii: {\n get: function () {\n return this._oneOverRadii;\n },\n },\n /**\n * Gets one over the squared radii of the ellipsoid.\n * @memberof Ellipsoid.prototype\n * @type {Cartesian3}\n * @readonly\n */\n oneOverRadiiSquared: {\n get: function () {\n return this._oneOverRadiiSquared;\n },\n },\n /**\n * Gets the minimum radius of the ellipsoid.\n * @memberof Ellipsoid.prototype\n * @type {number}\n * @readonly\n */\n minimumRadius: {\n get: function () {\n return this._minimumRadius;\n },\n },\n /**\n * Gets the maximum radius of the ellipsoid.\n * @memberof Ellipsoid.prototype\n * @type {number}\n * @readonly\n */\n maximumRadius: {\n get: function () {\n return this._maximumRadius;\n },\n },\n});\n\n/**\n * Duplicates an Ellipsoid instance.\n *\n * @param {Ellipsoid} ellipsoid The ellipsoid to duplicate.\n * @param {Ellipsoid} [result] The object onto which to store the result, or undefined if a new\n * instance should be created.\n * @returns {Ellipsoid} The cloned Ellipsoid. (Returns undefined if ellipsoid is undefined)\n */\nEllipsoid.clone = function (ellipsoid, result) {\n if (!defined(ellipsoid)) {\n return undefined;\n }\n const radii = ellipsoid._radii;\n\n if (!defined(result)) {\n return new Ellipsoid(radii.x, radii.y, radii.z);\n }\n\n Cartesian3.clone(radii, result._radii);\n Cartesian3.clone(ellipsoid._radiiSquared, result._radiiSquared);\n Cartesian3.clone(ellipsoid._radiiToTheFourth, result._radiiToTheFourth);\n Cartesian3.clone(ellipsoid._oneOverRadii, result._oneOverRadii);\n Cartesian3.clone(ellipsoid._oneOverRadiiSquared, result._oneOverRadiiSquared);\n result._minimumRadius = ellipsoid._minimumRadius;\n result._maximumRadius = ellipsoid._maximumRadius;\n result._centerToleranceSquared = ellipsoid._centerToleranceSquared;\n\n return result;\n};\n\n/**\n * Computes an Ellipsoid from a Cartesian specifying the radii in x, y, and z directions.\n *\n * @param {Cartesian3} [cartesian=Cartesian3.ZERO] The ellipsoid's radius in the x, y, and z directions.\n * @param {Ellipsoid} [result] The object onto which to store the result, or undefined if a new\n * instance should be created.\n * @returns {Ellipsoid} A new Ellipsoid instance.\n *\n * @exception {DeveloperError} All radii components must be greater than or equal to zero.\n *\n * @see Ellipsoid.WGS84\n * @see Ellipsoid.UNIT_SPHERE\n */\nEllipsoid.fromCartesian3 = function (cartesian, result) {\n if (!defined(result)) {\n result = new Ellipsoid();\n }\n\n if (!defined(cartesian)) {\n return result;\n }\n\n initialize(result, cartesian.x, cartesian.y, cartesian.z);\n return result;\n};\n\n/**\n * An Ellipsoid instance initialized to the WGS84 standard.\n *\n * @type {Ellipsoid}\n * @constant\n */\nEllipsoid.WGS84 = Object.freeze(\n new Ellipsoid(6378137.0, 6378137.0, 6356752.3142451793),\n);\n\n/**\n * An Ellipsoid instance initialized to radii of (1.0, 1.0, 1.0).\n *\n * @type {Ellipsoid}\n * @constant\n */\nEllipsoid.UNIT_SPHERE = Object.freeze(new Ellipsoid(1.0, 1.0, 1.0));\n\n/**\n * An Ellipsoid instance initialized to a sphere with the lunar radius.\n *\n * @type {Ellipsoid}\n * @constant\n */\nEllipsoid.MOON = Object.freeze(\n new Ellipsoid(\n CesiumMath.LUNAR_RADIUS,\n CesiumMath.LUNAR_RADIUS,\n CesiumMath.LUNAR_RADIUS,\n ),\n);\n\nEllipsoid._default = Ellipsoid.WGS84;\nObject.defineProperties(Ellipsoid, {\n /**\n * The default ellipsoid used when not otherwise specified.\n * @memberof Ellipsoid\n * @type {Ellipsoid}\n * @example\n * Cesium.Ellipsoid.default = Cesium.Ellipsoid.MOON;\n *\n * // Apollo 11 landing site\n * const position = Cesium.Cartesian3.fromRadians(\n * 0.67416,\n * 23.47315,\n * );\n */\n default: {\n get: function () {\n return Ellipsoid._default;\n },\n set: function (value) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"value\", value);\n //>>includeEnd('debug');\n\n Ellipsoid._default = value;\n Cartesian3._ellipsoidRadiiSquared = value.radiiSquared;\n Cartographic._ellipsoidOneOverRadii = value.oneOverRadii;\n Cartographic._ellipsoidOneOverRadiiSquared = value.oneOverRadiiSquared;\n Cartographic._ellipsoidCenterToleranceSquared =\n value._centerToleranceSquared;\n },\n },\n});\n\n/**\n * Duplicates an Ellipsoid instance.\n *\n * @param {Ellipsoid} [result] The object onto which to store the result, or undefined if a new\n * instance should be created.\n * @returns {Ellipsoid} The cloned Ellipsoid.\n */\nEllipsoid.prototype.clone = function (result) {\n return Ellipsoid.clone(this, result);\n};\n\n/**\n * The number of elements used to pack the object into an array.\n * @type {number}\n */\nEllipsoid.packedLength = Cartesian3.packedLength;\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {Ellipsoid} value The value to pack.\n * @param {number[]} array The array to pack into.\n * @param {number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {number[]} The array that was packed into\n */\nEllipsoid.pack = function (value, array, startingIndex) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"value\", value);\n Check.defined(\"array\", array);\n //>>includeEnd('debug');\n\n startingIndex = defaultValue(startingIndex, 0);\n\n Cartesian3.pack(value._radii, array, startingIndex);\n\n return array;\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {number[]} array The packed array.\n * @param {number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {Ellipsoid} [result] The object into which to store the result.\n * @returns {Ellipsoid} The modified result parameter or a new Ellipsoid instance if one was not provided.\n */\nEllipsoid.unpack = function (array, startingIndex, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.defined(\"array\", array);\n //>>includeEnd('debug');\n\n startingIndex = defaultValue(startingIndex, 0);\n\n const radii = Cartesian3.unpack(array, startingIndex);\n return Ellipsoid.fromCartesian3(radii, result);\n};\n\n/**\n * Computes the unit vector directed from the center of this ellipsoid toward the provided Cartesian position.\n * @function\n *\n * @param {Cartesian3} cartesian The Cartesian for which to to determine the geocentric normal.\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if none was provided.\n */\nEllipsoid.prototype.geocentricSurfaceNormal = Cartesian3.normalize;\n\n/**\n * Computes the normal of the plane tangent to the surface of the ellipsoid at the provided position.\n *\n * @param {Cartographic} cartographic The cartographic position for which to to determine the geodetic normal.\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if none was provided.\n */\nEllipsoid.prototype.geodeticSurfaceNormalCartographic = function (\n cartographic,\n result,\n) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"cartographic\", cartographic);\n //>>includeEnd('debug');\n\n const longitude = cartographic.longitude;\n const latitude = cartographic.latitude;\n const cosLatitude = Math.cos(latitude);\n\n const x = cosLatitude * Math.cos(longitude);\n const y = cosLatitude * Math.sin(longitude);\n const z = Math.sin(latitude);\n\n if (!defined(result)) {\n result = new Cartesian3();\n }\n result.x = x;\n result.y = y;\n result.z = z;\n return Cartesian3.normalize(result, result);\n};\n\n/**\n * Computes the normal of the plane tangent to the surface of the ellipsoid at the provided position.\n *\n * @param {Cartesian3} cartesian The Cartesian position for which to to determine the surface normal.\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if none was provided, or undefined if a normal cannot be found.\n */\nEllipsoid.prototype.geodeticSurfaceNormal = function (cartesian, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"cartesian\", cartesian);\n if (isNaN(cartesian.x) || isNaN(cartesian.y) || isNaN(cartesian.z)) {\n throw new DeveloperError(\"cartesian has a NaN component\");\n }\n //>>includeEnd('debug');\n if (\n Cartesian3.equalsEpsilon(cartesian, Cartesian3.ZERO, CesiumMath.EPSILON14)\n ) {\n return undefined;\n }\n if (!defined(result)) {\n result = new Cartesian3();\n }\n result = Cartesian3.multiplyComponents(\n cartesian,\n this._oneOverRadiiSquared,\n result,\n );\n return Cartesian3.normalize(result, result);\n};\n\nconst cartographicToCartesianNormal = new Cartesian3();\nconst cartographicToCartesianK = new Cartesian3();\n\n/**\n * Converts the provided cartographic to Cartesian representation.\n *\n * @param {Cartographic} cartographic The cartographic position.\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if none was provided.\n *\n * @example\n * //Create a Cartographic and determine it's Cartesian representation on a WGS84 ellipsoid.\n * const position = new Cesium.Cartographic(Cesium.Math.toRadians(21), Cesium.Math.toRadians(78), 5000);\n * const cartesianPosition = Cesium.Ellipsoid.WGS84.cartographicToCartesian(position);\n */\nEllipsoid.prototype.cartographicToCartesian = function (cartographic, result) {\n //`cartographic is required` is thrown from geodeticSurfaceNormalCartographic.\n const n = cartographicToCartesianNormal;\n const k = cartographicToCartesianK;\n this.geodeticSurfaceNormalCartographic(cartographic, n);\n Cartesian3.multiplyComponents(this._radiiSquared, n, k);\n const gamma = Math.sqrt(Cartesian3.dot(n, k));\n Cartesian3.divideByScalar(k, gamma, k);\n Cartesian3.multiplyByScalar(n, cartographic.height, n);\n\n if (!defined(result)) {\n result = new Cartesian3();\n }\n return Cartesian3.add(k, n, result);\n};\n\n/**\n * Converts the provided array of cartographics to an array of Cartesians.\n *\n * @param {Cartographic[]} cartographics An array of cartographic positions.\n * @param {Cartesian3[]} [result] The object onto which to store the result.\n * @returns {Cartesian3[]} The modified result parameter or a new Array instance if none was provided.\n *\n * @example\n * //Convert an array of Cartographics and determine their Cartesian representation on a WGS84 ellipsoid.\n * const positions = [new Cesium.Cartographic(Cesium.Math.toRadians(21), Cesium.Math.toRadians(78), 0),\n * new Cesium.Cartographic(Cesium.Math.toRadians(21.321), Cesium.Math.toRadians(78.123), 100),\n * new Cesium.Cartographic(Cesium.Math.toRadians(21.645), Cesium.Math.toRadians(78.456), 250)];\n * const cartesianPositions = Cesium.Ellipsoid.WGS84.cartographicArrayToCartesianArray(positions);\n */\nEllipsoid.prototype.cartographicArrayToCartesianArray = function (\n cartographics,\n result,\n) {\n //>>includeStart('debug', pragmas.debug);\n Check.defined(\"cartographics\", cartographics);\n //>>includeEnd('debug')\n\n const length = cartographics.length;\n if (!defined(result)) {\n result = new Array(length);\n } else {\n result.length = length;\n }\n for (let i = 0; i < length; i++) {\n result[i] = this.cartographicToCartesian(cartographics[i], result[i]);\n }\n return result;\n};\n\nconst cartesianToCartographicN = new Cartesian3();\nconst cartesianToCartographicP = new Cartesian3();\nconst cartesianToCartographicH = new Cartesian3();\n\n/**\n * Converts the provided cartesian to cartographic representation.\n * The cartesian is undefined at the center of the ellipsoid.\n *\n * @param {Cartesian3} cartesian The Cartesian position to convert to cartographic representation.\n * @param {Cartographic} [result] The object onto which to store the result.\n * @returns {Cartographic} The modified result parameter, new Cartographic instance if none was provided, or undefined if the cartesian is at the center of the ellipsoid.\n *\n * @example\n * //Create a Cartesian and determine it's Cartographic representation on a WGS84 ellipsoid.\n * const position = new Cesium.Cartesian3(17832.12, 83234.52, 952313.73);\n * const cartographicPosition = Cesium.Ellipsoid.WGS84.cartesianToCartographic(position);\n */\nEllipsoid.prototype.cartesianToCartographic = function (cartesian, result) {\n //`cartesian is required.` is thrown from scaleToGeodeticSurface\n const p = this.scaleToGeodeticSurface(cartesian, cartesianToCartographicP);\n\n if (!defined(p)) {\n return undefined;\n }\n\n const n = this.geodeticSurfaceNormal(p, cartesianToCartographicN);\n const h = Cartesian3.subtract(cartesian, p, cartesianToCartographicH);\n\n const longitude = Math.atan2(n.y, n.x);\n const latitude = Math.asin(n.z);\n const height =\n CesiumMath.sign(Cartesian3.dot(h, cartesian)) * Cartesian3.magnitude(h);\n\n if (!defined(result)) {\n return new Cartographic(longitude, latitude, height);\n }\n result.longitude = longitude;\n result.latitude = latitude;\n result.height = height;\n return result;\n};\n\n/**\n * Converts the provided array of cartesians to an array of cartographics.\n *\n * @param {Cartesian3[]} cartesians An array of Cartesian positions.\n * @param {Cartographic[]} [result] The object onto which to store the result.\n * @returns {Cartographic[]} The modified result parameter or a new Array instance if none was provided.\n *\n * @example\n * //Create an array of Cartesians and determine their Cartographic representation on a WGS84 ellipsoid.\n * const positions = [new Cesium.Cartesian3(17832.12, 83234.52, 952313.73),\n * new Cesium.Cartesian3(17832.13, 83234.53, 952313.73),\n * new Cesium.Cartesian3(17832.14, 83234.54, 952313.73)]\n * const cartographicPositions = Cesium.Ellipsoid.WGS84.cartesianArrayToCartographicArray(positions);\n */\nEllipsoid.prototype.cartesianArrayToCartographicArray = function (\n cartesians,\n result,\n) {\n //>>includeStart('debug', pragmas.debug);\n Check.defined(\"cartesians\", cartesians);\n //>>includeEnd('debug');\n\n const length = cartesians.length;\n if (!defined(result)) {\n result = new Array(length);\n } else {\n result.length = length;\n }\n for (let i = 0; i < length; ++i) {\n result[i] = this.cartesianToCartographic(cartesians[i], result[i]);\n }\n return result;\n};\n\n/**\n * Scales the provided Cartesian position along the geodetic surface normal\n * so that it is on the surface of this ellipsoid. If the position is\n * at the center of the ellipsoid, this function returns undefined.\n *\n * @param {Cartesian3} cartesian The Cartesian position to scale.\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter, a new Cartesian3 instance if none was provided, or undefined if the position is at the center.\n */\nEllipsoid.prototype.scaleToGeodeticSurface = function (cartesian, result) {\n return scaleToGeodeticSurface(\n cartesian,\n this._oneOverRadii,\n this._oneOverRadiiSquared,\n this._centerToleranceSquared,\n result,\n );\n};\n\n/**\n * Scales the provided Cartesian position along the geocentric surface normal\n * so that it is on the surface of this ellipsoid.\n *\n * @param {Cartesian3} cartesian The Cartesian position to scale.\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if none was provided.\n */\nEllipsoid.prototype.scaleToGeocentricSurface = function (cartesian, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"cartesian\", cartesian);\n //>>includeEnd('debug');\n\n if (!defined(result)) {\n result = new Cartesian3();\n }\n\n const positionX = cartesian.x;\n const positionY = cartesian.y;\n const positionZ = cartesian.z;\n const oneOverRadiiSquared = this._oneOverRadiiSquared;\n\n const beta =\n 1.0 /\n Math.sqrt(\n positionX * positionX * oneOverRadiiSquared.x +\n positionY * positionY * oneOverRadiiSquared.y +\n positionZ * positionZ * oneOverRadiiSquared.z,\n );\n\n return Cartesian3.multiplyByScalar(cartesian, beta, result);\n};\n\n/**\n * Transforms a Cartesian X, Y, Z position to the ellipsoid-scaled space by multiplying\n * its components by the result of {@link Ellipsoid#oneOverRadii}.\n *\n * @param {Cartesian3} position The position to transform.\n * @param {Cartesian3} [result] The position to which to copy the result, or undefined to create and\n * return a new instance.\n * @returns {Cartesian3} The position expressed in the scaled space. The returned instance is the\n * one passed as the result parameter if it is not undefined, or a new instance of it is.\n */\nEllipsoid.prototype.transformPositionToScaledSpace = function (\n position,\n result,\n) {\n if (!defined(result)) {\n result = new Cartesian3();\n }\n\n return Cartesian3.multiplyComponents(position, this._oneOverRadii, result);\n};\n\n/**\n * Transforms a Cartesian X, Y, Z position from the ellipsoid-scaled space by multiplying\n * its components by the result of {@link Ellipsoid#radii}.\n *\n * @param {Cartesian3} position The position to transform.\n * @param {Cartesian3} [result] The position to which to copy the result, or undefined to create and\n * return a new instance.\n * @returns {Cartesian3} The position expressed in the unscaled space. The returned instance is the\n * one passed as the result parameter if it is not undefined, or a new instance of it is.\n */\nEllipsoid.prototype.transformPositionFromScaledSpace = function (\n position,\n result,\n) {\n if (!defined(result)) {\n result = new Cartesian3();\n }\n\n return Cartesian3.multiplyComponents(position, this._radii, result);\n};\n\n/**\n * Compares this Ellipsoid against the provided Ellipsoid componentwise and returns\n * true
if they are equal, false
otherwise.\n *\n * @param {Ellipsoid} [right] The other Ellipsoid.\n * @returns {boolean} true
if they are equal, false
otherwise.\n */\nEllipsoid.prototype.equals = function (right) {\n return (\n this === right ||\n (defined(right) && Cartesian3.equals(this._radii, right._radii))\n );\n};\n\n/**\n * Creates a string representing this Ellipsoid in the format '(radii.x, radii.y, radii.z)'.\n *\n * @returns {string} A string representing this ellipsoid in the format '(radii.x, radii.y, radii.z)'.\n */\nEllipsoid.prototype.toString = function () {\n return this._radii.toString();\n};\n\n/**\n * Computes a point which is the intersection of the surface normal with the z-axis.\n *\n * @param {Cartesian3} position the position. must be on the surface of the ellipsoid.\n * @param {number} [buffer = 0.0] A buffer to subtract from the ellipsoid size when checking if the point is inside the ellipsoid.\n * 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.\n * In WGS84 datum, intersection point is at max z = +-42841.31151331382 (0.673% of z-axis).\n * Intersection point could be outside the ellipsoid if the ratio of MajorAxis / AxisOfRotation is bigger than the square root of 2\n * @param {Cartesian3} [result] The cartesian to which to copy the result, or undefined to create and\n * return a new instance.\n * @returns {Cartesian3 | undefined} the intersection point if it's inside the ellipsoid, undefined otherwise\n *\n * @exception {DeveloperError} position is required.\n * @exception {DeveloperError} Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y).\n * @exception {DeveloperError} Ellipsoid.radii.z must be greater than 0.\n */\nEllipsoid.prototype.getSurfaceNormalIntersectionWithZAxis = function (\n position,\n buffer,\n result,\n) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"position\", position);\n\n if (\n !CesiumMath.equalsEpsilon(\n this._radii.x,\n this._radii.y,\n CesiumMath.EPSILON15,\n )\n ) {\n throw new DeveloperError(\n \"Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)\",\n );\n }\n\n Check.typeOf.number.greaterThan(\"Ellipsoid.radii.z\", this._radii.z, 0);\n //>>includeEnd('debug');\n\n buffer = defaultValue(buffer, 0.0);\n\n const squaredXOverSquaredZ = this._squaredXOverSquaredZ;\n\n if (!defined(result)) {\n result = new Cartesian3();\n }\n\n result.x = 0.0;\n result.y = 0.0;\n result.z = position.z * (1 - squaredXOverSquaredZ);\n\n if (Math.abs(result.z) >= this._radii.z - buffer) {\n return undefined;\n }\n\n return result;\n};\n\nconst scratchEndpoint = new Cartesian3();\n\n/**\n * Computes the ellipsoid curvatures at a given position on the surface.\n *\n * @param {Cartesian3} surfacePosition The position on the ellipsoid surface where curvatures will be calculated.\n * @param {Cartesian2} [result] The cartesian to which to copy the result, or undefined to create and return a new instance.\n * @returns {Cartesian2} The local curvature of the ellipsoid surface at the provided position, in east and north directions.\n *\n * @exception {DeveloperError} position is required.\n */\nEllipsoid.prototype.getLocalCurvature = function (surfacePosition, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"surfacePosition\", surfacePosition);\n //>>includeEnd('debug');\n\n if (!defined(result)) {\n result = new Cartesian2();\n }\n\n const primeVerticalEndpoint = this.getSurfaceNormalIntersectionWithZAxis(\n surfacePosition,\n 0.0,\n scratchEndpoint,\n );\n const primeVerticalRadius = Cartesian3.distance(\n surfacePosition,\n primeVerticalEndpoint,\n );\n // meridional radius = (1 - e^2) * primeVerticalRadius^3 / a^2\n // where 1 - e^2 = b^2 / a^2,\n // so meridional = b^2 * primeVerticalRadius^3 / a^4\n // = (b * primeVerticalRadius / a^2)^2 * primeVertical\n const radiusRatio =\n (this.minimumRadius * primeVerticalRadius) / this.maximumRadius ** 2;\n const meridionalRadius = primeVerticalRadius * radiusRatio ** 2;\n\n return Cartesian2.fromElements(\n 1.0 / primeVerticalRadius,\n 1.0 / meridionalRadius,\n result,\n );\n};\n\nconst abscissas = [\n 0.14887433898163, 0.43339539412925, 0.67940956829902, 0.86506336668898,\n 0.97390652851717, 0.0,\n];\nconst weights = [\n 0.29552422471475, 0.26926671930999, 0.21908636251598, 0.14945134915058,\n 0.066671344308684, 0.0,\n];\n\n/**\n * Compute the 10th order Gauss-Legendre Quadrature of the given definite integral.\n *\n * @param {number} a The lower bound for the integration.\n * @param {number} b The upper bound for the integration.\n * @param {Ellipsoid~RealValuedScalarFunction} func The function to integrate.\n * @returns {number} The value of the integral of the given function over the given domain.\n *\n * @private\n */\nfunction gaussLegendreQuadrature(a, b, func) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.number(\"a\", a);\n Check.typeOf.number(\"b\", b);\n Check.typeOf.func(\"func\", func);\n //>>includeEnd('debug');\n\n // The range is half of the normal range since the five weights add to one (ten weights add to two).\n // The values of the abscissas are multiplied by two to account for this.\n const xMean = 0.5 * (b + a);\n const xRange = 0.5 * (b - a);\n\n let sum = 0.0;\n for (let i = 0; i < 5; i++) {\n const dx = xRange * abscissas[i];\n sum += weights[i] * (func(xMean + dx) + func(xMean - dx));\n }\n\n // Scale the sum to the range of x.\n sum *= xRange;\n return sum;\n}\n\n/**\n * A real valued scalar function.\n * @callback Ellipsoid~RealValuedScalarFunction\n *\n * @param {number} x The value used to evaluate the function.\n * @returns {number} The value of the function at x.\n *\n * @private\n */\n\n/**\n * Computes an approximation of the surface area of a rectangle on the surface of an ellipsoid using\n * Gauss-Legendre 10th order quadrature.\n *\n * @param {Rectangle} rectangle The rectangle used for computing the surface area.\n * @returns {number} The approximate area of the rectangle on the surface of this ellipsoid.\n */\nEllipsoid.prototype.surfaceArea = function (rectangle) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"rectangle\", rectangle);\n //>>includeEnd('debug');\n const minLongitude = rectangle.west;\n let maxLongitude = rectangle.east;\n const minLatitude = rectangle.south;\n const maxLatitude = rectangle.north;\n\n while (maxLongitude < minLongitude) {\n maxLongitude += CesiumMath.TWO_PI;\n }\n\n const radiiSquared = this._radiiSquared;\n const a2 = radiiSquared.x;\n const b2 = radiiSquared.y;\n const c2 = radiiSquared.z;\n const a2b2 = a2 * b2;\n return gaussLegendreQuadrature(minLatitude, maxLatitude, function (lat) {\n // phi represents the angle measured from the north pole\n // sin(phi) = sin(pi / 2 - lat) = cos(lat), cos(phi) is similar\n const sinPhi = Math.cos(lat);\n const cosPhi = Math.sin(lat);\n return (\n Math.cos(lat) *\n gaussLegendreQuadrature(minLongitude, maxLongitude, function (lon) {\n const cosTheta = Math.cos(lon);\n const sinTheta = Math.sin(lon);\n return Math.sqrt(\n a2b2 * cosPhi * cosPhi +\n c2 *\n (b2 * cosTheta * cosTheta + a2 * sinTheta * sinTheta) *\n sinPhi *\n sinPhi,\n );\n })\n );\n });\n};\n\nexport default Ellipsoid;\n","import Cartesian3 from \"./Cartesian3.js\";\nimport Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport CesiumMath from \"./Math.js\";\nimport scaleToGeodeticSurface from \"./scaleToGeodeticSurface.js\";\n\n/**\n * A position defined by longitude, latitude, and height.\n * @alias Cartographic\n * @constructor\n *\n * @param {number} [longitude=0.0] The longitude, in radians.\n * @param {number} [latitude=0.0] The latitude, in radians.\n * @param {number} [height=0.0] The height, in meters, above the ellipsoid.\n *\n * @see Ellipsoid\n */\nfunction Cartographic(longitude, latitude, height) {\n /**\n * The longitude, in radians.\n * @type {number}\n * @default 0.0\n */\n this.longitude = defaultValue(longitude, 0.0);\n\n /**\n * The latitude, in radians.\n * @type {number}\n * @default 0.0\n */\n this.latitude = defaultValue(latitude, 0.0);\n\n /**\n * The height, in meters, above the ellipsoid.\n * @type {number}\n * @default 0.0\n */\n this.height = defaultValue(height, 0.0);\n}\n\n/**\n * Creates a new Cartographic instance from longitude and latitude\n * specified in radians.\n *\n * @param {number} longitude The longitude, in radians.\n * @param {number} latitude The latitude, in radians.\n * @param {number} [height=0.0] The height, in meters, above the ellipsoid.\n * @param {Cartographic} [result] The object onto which to store the result.\n * @returns {Cartographic} The modified result parameter or a new Cartographic instance if one was not provided.\n */\nCartographic.fromRadians = function (longitude, latitude, height, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.number(\"longitude\", longitude);\n Check.typeOf.number(\"latitude\", latitude);\n //>>includeEnd('debug');\n\n height = defaultValue(height, 0.0);\n\n if (!defined(result)) {\n return new Cartographic(longitude, latitude, height);\n }\n\n result.longitude = longitude;\n result.latitude = latitude;\n result.height = height;\n return result;\n};\n\n/**\n * Creates a new Cartographic instance from longitude and latitude\n * specified in degrees. The values in the resulting object will\n * be in radians.\n *\n * @param {number} longitude The longitude, in degrees.\n * @param {number} latitude The latitude, in degrees.\n * @param {number} [height=0.0] The height, in meters, above the ellipsoid.\n * @param {Cartographic} [result] The object onto which to store the result.\n * @returns {Cartographic} The modified result parameter or a new Cartographic instance if one was not provided.\n */\nCartographic.fromDegrees = function (longitude, latitude, height, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.number(\"longitude\", longitude);\n Check.typeOf.number(\"latitude\", latitude);\n //>>includeEnd('debug');\n\n longitude = CesiumMath.toRadians(longitude);\n latitude = CesiumMath.toRadians(latitude);\n\n return Cartographic.fromRadians(longitude, latitude, height, result);\n};\n\nconst cartesianToCartographicN = new Cartesian3();\nconst cartesianToCartographicP = new Cartesian3();\nconst cartesianToCartographicH = new Cartesian3();\n\n// To avoid circular dependencies, these are set by Ellipsoid when Ellipsoid.default is set.\nCartographic._ellipsoidOneOverRadii = new Cartesian3(\n 1.0 / 6378137.0,\n 1.0 / 6378137.0,\n 1.0 / 6356752.3142451793,\n);\nCartographic._ellipsoidOneOverRadiiSquared = new Cartesian3(\n 1.0 / (6378137.0 * 6378137.0),\n 1.0 / (6378137.0 * 6378137.0),\n 1.0 / (6356752.3142451793 * 6356752.3142451793),\n);\nCartographic._ellipsoidCenterToleranceSquared = CesiumMath.EPSILON1;\n\n/**\n * Creates a new Cartographic instance from a Cartesian position. The values in the\n * resulting object will be in radians.\n *\n * @param {Cartesian3} cartesian The Cartesian position to convert to cartographic representation.\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.default] The ellipsoid on which the position lies.\n * @param {Cartographic} [result] The object onto which to store the result.\n * @returns {Cartographic} The modified result parameter, new Cartographic instance if none was provided, or undefined if the cartesian is at the center of the ellipsoid.\n */\nCartographic.fromCartesian = function (cartesian, ellipsoid, result) {\n const oneOverRadii = defined(ellipsoid)\n ? ellipsoid.oneOverRadii\n : Cartographic._ellipsoidOneOverRadii;\n const oneOverRadiiSquared = defined(ellipsoid)\n ? ellipsoid.oneOverRadiiSquared\n : Cartographic._ellipsoidOneOverRadiiSquared;\n const centerToleranceSquared = defined(ellipsoid)\n ? ellipsoid._centerToleranceSquared\n : Cartographic._ellipsoidCenterToleranceSquared;\n\n //`cartesian is required.` is thrown from scaleToGeodeticSurface\n const p = scaleToGeodeticSurface(\n cartesian,\n oneOverRadii,\n oneOverRadiiSquared,\n centerToleranceSquared,\n cartesianToCartographicP,\n );\n\n if (!defined(p)) {\n return undefined;\n }\n\n let n = Cartesian3.multiplyComponents(\n p,\n oneOverRadiiSquared,\n cartesianToCartographicN,\n );\n n = Cartesian3.normalize(n, n);\n\n const h = Cartesian3.subtract(cartesian, p, cartesianToCartographicH);\n\n const longitude = Math.atan2(n.y, n.x);\n const latitude = Math.asin(n.z);\n const height =\n CesiumMath.sign(Cartesian3.dot(h, cartesian)) * Cartesian3.magnitude(h);\n\n if (!defined(result)) {\n return new Cartographic(longitude, latitude, height);\n }\n result.longitude = longitude;\n result.latitude = latitude;\n result.height = height;\n return result;\n};\n\n/**\n * Creates a new Cartesian3 instance from a Cartographic input. The values in the inputted\n * object should be in radians.\n *\n * @param {Cartographic} cartographic Input to be converted into a Cartesian3 output.\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.default] The ellipsoid on which the position lies.\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {Cartesian3} The position\n */\nCartographic.toCartesian = function (cartographic, ellipsoid, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.defined(\"cartographic\", cartographic);\n //>>includeEnd('debug');\n\n return Cartesian3.fromRadians(\n cartographic.longitude,\n cartographic.latitude,\n cartographic.height,\n ellipsoid,\n result,\n );\n};\n\n/**\n * Duplicates a Cartographic instance.\n *\n * @param {Cartographic} cartographic The cartographic to duplicate.\n * @param {Cartographic} [result] The object onto which to store the result.\n * @returns {Cartographic} The modified result parameter or a new Cartographic instance if one was not provided. (Returns undefined if cartographic is undefined)\n */\nCartographic.clone = function (cartographic, result) {\n if (!defined(cartographic)) {\n return undefined;\n }\n if (!defined(result)) {\n return new Cartographic(\n cartographic.longitude,\n cartographic.latitude,\n cartographic.height,\n );\n }\n result.longitude = cartographic.longitude;\n result.latitude = cartographic.latitude;\n result.height = cartographic.height;\n return result;\n};\n\n/**\n * Compares the provided cartographics componentwise and returns\n * true
if they are equal, false
otherwise.\n *\n * @param {Cartographic} [left] The first cartographic.\n * @param {Cartographic} [right] The second cartographic.\n * @returns {boolean} true
if left and right are equal, false
otherwise.\n */\nCartographic.equals = function (left, right) {\n return (\n left === right ||\n (defined(left) &&\n defined(right) &&\n left.longitude === right.longitude &&\n left.latitude === right.latitude &&\n left.height === right.height)\n );\n};\n\n/**\n * Compares the provided cartographics componentwise and returns\n * true
if they are within the provided epsilon,\n * false
otherwise.\n *\n * @param {Cartographic} [left] The first cartographic.\n * @param {Cartographic} [right] The second cartographic.\n * @param {number} [epsilon=0] The epsilon to use for equality testing.\n * @returns {boolean} true
if left and right are within the provided epsilon, false
otherwise.\n */\nCartographic.equalsEpsilon = function (left, right, epsilon) {\n epsilon = defaultValue(epsilon, 0);\n\n return (\n left === right ||\n (defined(left) &&\n defined(right) &&\n Math.abs(left.longitude - right.longitude) <= epsilon &&\n Math.abs(left.latitude - right.latitude) <= epsilon &&\n Math.abs(left.height - right.height) <= epsilon)\n );\n};\n\n/**\n * An immutable Cartographic instance initialized to (0.0, 0.0, 0.0).\n *\n * @type {Cartographic}\n * @constant\n */\nCartographic.ZERO = Object.freeze(new Cartographic(0.0, 0.0, 0.0));\n\n/**\n * Duplicates this instance.\n *\n * @param {Cartographic} [result] The object onto which to store the result.\n * @returns {Cartographic} The modified result parameter or a new Cartographic instance if one was not provided.\n */\nCartographic.prototype.clone = function (result) {\n return Cartographic.clone(this, result);\n};\n\n/**\n * Compares the provided against this cartographic componentwise and returns\n * true
if they are equal, false
otherwise.\n *\n * @param {Cartographic} [right] The second cartographic.\n * @returns {boolean} true
if left and right are equal, false
otherwise.\n */\nCartographic.prototype.equals = function (right) {\n return Cartographic.equals(this, right);\n};\n\n/**\n * Compares the provided against this cartographic componentwise and returns\n * true
if they are within the provided epsilon,\n * false
otherwise.\n *\n * @param {Cartographic} [right] The second cartographic.\n * @param {number} [epsilon=0] The epsilon to use for equality testing.\n * @returns {boolean} true
if left and right are within the provided epsilon, false
otherwise.\n */\nCartographic.prototype.equalsEpsilon = function (right, epsilon) {\n return Cartographic.equalsEpsilon(this, right, epsilon);\n};\n\n/**\n * Creates a string representing this cartographic in the format '(longitude, latitude, height)'.\n *\n * @returns {string} A string representing the provided cartographic in the format '(longitude, latitude, height)'.\n */\nCartographic.prototype.toString = function () {\n return `(${this.longitude}, ${this.latitude}, ${this.height})`;\n};\nexport default Cartographic;\n","import Cartesian3 from \"./Cartesian3.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport CesiumMath from \"./Math.js\";\n\nconst scaleToGeodeticSurfaceIntersection = new Cartesian3();\nconst scaleToGeodeticSurfaceGradient = new Cartesian3();\n\n/**\n * Scales the provided Cartesian position along the geodetic surface normal\n * so that it is on the surface of this ellipsoid. If the position is\n * at the center of the ellipsoid, this function returns undefined.\n *\n * @param {Cartesian3} cartesian The Cartesian position to scale.\n * @param {Cartesian3} oneOverRadii One over radii of the ellipsoid.\n * @param {Cartesian3} oneOverRadiiSquared One over radii squared of the ellipsoid.\n * @param {number} centerToleranceSquared Tolerance for closeness to the center.\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter, a new Cartesian3 instance if none was provided, or undefined if the position is at the center.\n *\n * @function scaleToGeodeticSurface\n *\n * @private\n */\nfunction scaleToGeodeticSurface(\n cartesian,\n oneOverRadii,\n oneOverRadiiSquared,\n centerToleranceSquared,\n result,\n) {\n //>>includeStart('debug', pragmas.debug);\n if (!defined(cartesian)) {\n throw new DeveloperError(\"cartesian is required.\");\n }\n if (!defined(oneOverRadii)) {\n throw new DeveloperError(\"oneOverRadii is required.\");\n }\n if (!defined(oneOverRadiiSquared)) {\n throw new DeveloperError(\"oneOverRadiiSquared is required.\");\n }\n if (!defined(centerToleranceSquared)) {\n throw new DeveloperError(\"centerToleranceSquared is required.\");\n }\n //>>includeEnd('debug');\n\n const positionX = cartesian.x;\n const positionY = cartesian.y;\n const positionZ = cartesian.z;\n\n const oneOverRadiiX = oneOverRadii.x;\n const oneOverRadiiY = oneOverRadii.y;\n const oneOverRadiiZ = oneOverRadii.z;\n\n const x2 = positionX * positionX * oneOverRadiiX * oneOverRadiiX;\n const y2 = positionY * positionY * oneOverRadiiY * oneOverRadiiY;\n const z2 = positionZ * positionZ * oneOverRadiiZ * oneOverRadiiZ;\n\n // Compute the squared ellipsoid norm.\n const squaredNorm = x2 + y2 + z2;\n const ratio = Math.sqrt(1.0 / squaredNorm);\n\n // As an initial approximation, assume that the radial intersection is the projection point.\n const intersection = Cartesian3.multiplyByScalar(\n cartesian,\n ratio,\n scaleToGeodeticSurfaceIntersection,\n );\n\n // If the position is near the center, the iteration will not converge.\n if (squaredNorm < centerToleranceSquared) {\n return !isFinite(ratio)\n ? undefined\n : Cartesian3.clone(intersection, result);\n }\n\n const oneOverRadiiSquaredX = oneOverRadiiSquared.x;\n const oneOverRadiiSquaredY = oneOverRadiiSquared.y;\n const oneOverRadiiSquaredZ = oneOverRadiiSquared.z;\n\n // Use the gradient at the intersection point in place of the true unit normal.\n // The difference in magnitude will be absorbed in the multiplier.\n const gradient = scaleToGeodeticSurfaceGradient;\n gradient.x = intersection.x * oneOverRadiiSquaredX * 2.0;\n gradient.y = intersection.y * oneOverRadiiSquaredY * 2.0;\n gradient.z = intersection.z * oneOverRadiiSquaredZ * 2.0;\n\n // Compute the initial guess at the normal vector multiplier, lambda.\n let lambda =\n ((1.0 - ratio) * Cartesian3.magnitude(cartesian)) /\n (0.5 * Cartesian3.magnitude(gradient));\n let correction = 0.0;\n\n let func;\n let denominator;\n let xMultiplier;\n let yMultiplier;\n let zMultiplier;\n let xMultiplier2;\n let yMultiplier2;\n let zMultiplier2;\n let xMultiplier3;\n let yMultiplier3;\n let zMultiplier3;\n\n do {\n lambda -= correction;\n\n xMultiplier = 1.0 / (1.0 + lambda * oneOverRadiiSquaredX);\n yMultiplier = 1.0 / (1.0 + lambda * oneOverRadiiSquaredY);\n zMultiplier = 1.0 / (1.0 + lambda * oneOverRadiiSquaredZ);\n\n xMultiplier2 = xMultiplier * xMultiplier;\n yMultiplier2 = yMultiplier * yMultiplier;\n zMultiplier2 = zMultiplier * zMultiplier;\n\n xMultiplier3 = xMultiplier2 * xMultiplier;\n yMultiplier3 = yMultiplier2 * yMultiplier;\n zMultiplier3 = zMultiplier2 * zMultiplier;\n\n func = x2 * xMultiplier2 + y2 * yMultiplier2 + z2 * zMultiplier2 - 1.0;\n\n // \"denominator\" here refers to the use of this expression in the velocity and acceleration\n // computations in the sections to follow.\n denominator =\n x2 * xMultiplier3 * oneOverRadiiSquaredX +\n y2 * yMultiplier3 * oneOverRadiiSquaredY +\n z2 * zMultiplier3 * oneOverRadiiSquaredZ;\n\n const derivative = -2.0 * denominator;\n\n correction = func / derivative;\n } while (Math.abs(func) > CesiumMath.EPSILON12);\n\n if (!defined(result)) {\n return new Cartesian3(\n positionX * xMultiplier,\n positionY * yMultiplier,\n positionZ * zMultiplier,\n );\n }\n result.x = positionX * xMultiplier;\n result.y = positionY * yMultiplier;\n result.z = positionZ * zMultiplier;\n return result;\n}\nexport default scaleToGeodeticSurface;\n","import Cartesian3 from \"./Cartesian3.js\";\nimport Cartesian4 from \"./Cartesian4.js\";\nimport Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport CesiumMath from \"./Math.js\";\nimport Matrix3 from \"./Matrix3.js\";\nimport RuntimeError from \"./RuntimeError.js\";\n\n/**\n * A 4x4 matrix, indexable as a column-major order array.\n * Constructor parameters are in row-major order for code readability.\n * @alias Matrix4\n * @constructor\n * @implements {ArrayLike[0.0, 0.0, 0.0, 1.0]
)\n * by a 3x3 rotation matrix. This is an optimization\n * for Matrix4.multiply(m, Matrix4.fromRotationTranslation(rotation), m);
with less allocations and arithmetic operations.\n *\n * @param {Matrix4} matrix The matrix on the left-hand side.\n * @param {Matrix3} rotation The 3x3 rotation matrix on the right-hand side.\n * @param {Matrix4} result The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter.\n *\n * @example\n * // Instead of Cesium.Matrix4.multiply(m, Cesium.Matrix4.fromRotationTranslation(rotation), m);\n * Cesium.Matrix4.multiplyByMatrix3(m, rotation, m);\n */\nMatrix4.multiplyByMatrix3 = function (matrix, rotation, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"matrix\", matrix);\n Check.typeOf.object(\"rotation\", rotation);\n Check.typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n\n const left0 = matrix[0];\n const left1 = matrix[1];\n const left2 = matrix[2];\n const left4 = matrix[4];\n const left5 = matrix[5];\n const left6 = matrix[6];\n const left8 = matrix[8];\n const left9 = matrix[9];\n const left10 = matrix[10];\n\n const right0 = rotation[0];\n const right1 = rotation[1];\n const right2 = rotation[2];\n const right4 = rotation[3];\n const right5 = rotation[4];\n const right6 = rotation[5];\n const right8 = rotation[6];\n const right9 = rotation[7];\n const right10 = rotation[8];\n\n const column0Row0 = left0 * right0 + left4 * right1 + left8 * right2;\n const column0Row1 = left1 * right0 + left5 * right1 + left9 * right2;\n const column0Row2 = left2 * right0 + left6 * right1 + left10 * right2;\n\n const column1Row0 = left0 * right4 + left4 * right5 + left8 * right6;\n const column1Row1 = left1 * right4 + left5 * right5 + left9 * right6;\n const column1Row2 = left2 * right4 + left6 * right5 + left10 * right6;\n\n const column2Row0 = left0 * right8 + left4 * right9 + left8 * right10;\n const column2Row1 = left1 * right8 + left5 * right9 + left9 * right10;\n const column2Row2 = left2 * right8 + left6 * right9 + left10 * right10;\n\n result[0] = column0Row0;\n result[1] = column0Row1;\n result[2] = column0Row2;\n result[3] = 0.0;\n result[4] = column1Row0;\n result[5] = column1Row1;\n result[6] = column1Row2;\n result[7] = 0.0;\n result[8] = column2Row0;\n result[9] = column2Row1;\n result[10] = column2Row2;\n result[11] = 0.0;\n result[12] = matrix[12];\n result[13] = matrix[13];\n result[14] = matrix[14];\n result[15] = matrix[15];\n return result;\n};\n\n/**\n * Multiplies a transformation matrix (with a bottom row of [0.0, 0.0, 0.0, 1.0]
)\n * by an implicit translation matrix defined by a {@link Cartesian3}. This is an optimization\n * for Matrix4.multiply(m, Matrix4.fromTranslation(position), m);
with less allocations and arithmetic operations.\n *\n * @param {Matrix4} matrix The matrix on the left-hand side.\n * @param {Cartesian3} translation The translation on the right-hand side.\n * @param {Matrix4} result The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter.\n *\n * @example\n * // Instead of Cesium.Matrix4.multiply(m, Cesium.Matrix4.fromTranslation(position), m);\n * Cesium.Matrix4.multiplyByTranslation(m, position, m);\n */\nMatrix4.multiplyByTranslation = function (matrix, translation, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"matrix\", matrix);\n Check.typeOf.object(\"translation\", translation);\n Check.typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n\n const x = translation.x;\n const y = translation.y;\n const z = translation.z;\n\n const tx = x * matrix[0] + y * matrix[4] + z * matrix[8] + matrix[12];\n const ty = x * matrix[1] + y * matrix[5] + z * matrix[9] + matrix[13];\n const tz = x * matrix[2] + y * matrix[6] + z * matrix[10] + matrix[14];\n\n result[0] = matrix[0];\n result[1] = matrix[1];\n result[2] = matrix[2];\n result[3] = matrix[3];\n result[4] = matrix[4];\n result[5] = matrix[5];\n result[6] = matrix[6];\n result[7] = matrix[7];\n result[8] = matrix[8];\n result[9] = matrix[9];\n result[10] = matrix[10];\n result[11] = matrix[11];\n result[12] = tx;\n result[13] = ty;\n result[14] = tz;\n result[15] = matrix[15];\n return result;\n};\n\n/**\n * Multiplies an affine transformation matrix (with a bottom row of [0.0, 0.0, 0.0, 1.0]
)\n * by an implicit non-uniform scale matrix. This is an optimization\n * for Matrix4.multiply(m, Matrix4.fromUniformScale(scale), m);
, where\n * m
must be an affine matrix.\n * This function performs fewer allocations and arithmetic operations.\n *\n * @param {Matrix4} matrix The affine matrix on the left-hand side.\n * @param {Cartesian3} scale The non-uniform scale on the right-hand side.\n * @param {Matrix4} result The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter.\n *\n *\n * @example\n * // Instead of Cesium.Matrix4.multiply(m, Cesium.Matrix4.fromScale(scale), m);\n * Cesium.Matrix4.multiplyByScale(m, scale, m);\n *\n * @see Matrix4.multiplyByUniformScale\n * @see Matrix4.fromScale\n * @see Matrix4.fromUniformScale\n * @see Matrix4.setScale\n * @see Matrix4.setUniformScale\n * @see Matrix4.getScale\n */\nMatrix4.multiplyByScale = function (matrix, scale, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"matrix\", matrix);\n Check.typeOf.object(\"scale\", scale);\n Check.typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n\n const scaleX = scale.x;\n const scaleY = scale.y;\n const scaleZ = scale.z;\n\n // Faster than Cartesian3.equals\n if (scaleX === 1.0 && scaleY === 1.0 && scaleZ === 1.0) {\n return Matrix4.clone(matrix, result);\n }\n\n result[0] = scaleX * matrix[0];\n result[1] = scaleX * matrix[1];\n result[2] = scaleX * matrix[2];\n result[3] = matrix[3];\n\n result[4] = scaleY * matrix[4];\n result[5] = scaleY * matrix[5];\n result[6] = scaleY * matrix[6];\n result[7] = matrix[7];\n\n result[8] = scaleZ * matrix[8];\n result[9] = scaleZ * matrix[9];\n result[10] = scaleZ * matrix[10];\n result[11] = matrix[11];\n\n result[12] = matrix[12];\n result[13] = matrix[13];\n result[14] = matrix[14];\n result[15] = matrix[15];\n\n return result;\n};\n\n/**\n * Computes the product of a matrix times a uniform scale, as if the scale were a scale matrix.\n *\n * @param {Matrix4} matrix The matrix on the left-hand side.\n * @param {number} scale The uniform scale on the right-hand side.\n * @param {Matrix4} result The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter.\n *\n * @example\n * // Instead of Cesium.Matrix4.multiply(m, Cesium.Matrix4.fromUniformScale(scale), m);\n * Cesium.Matrix4.multiplyByUniformScale(m, scale, m);\n *\n * @see Matrix4.multiplyByScale\n * @see Matrix4.fromScale\n * @see Matrix4.fromUniformScale\n * @see Matrix4.setScale\n * @see Matrix4.setUniformScale\n * @see Matrix4.getScale\n */\nMatrix4.multiplyByUniformScale = function (matrix, scale, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"matrix\", matrix);\n Check.typeOf.number(\"scale\", scale);\n Check.typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n\n result[0] = matrix[0] * scale;\n result[1] = matrix[1] * scale;\n result[2] = matrix[2] * scale;\n result[3] = matrix[3];\n\n result[4] = matrix[4] * scale;\n result[5] = matrix[5] * scale;\n result[6] = matrix[6] * scale;\n result[7] = matrix[7];\n\n result[8] = matrix[8] * scale;\n result[9] = matrix[9] * scale;\n result[10] = matrix[10] * scale;\n result[11] = matrix[11];\n\n result[12] = matrix[12];\n result[13] = matrix[13];\n result[14] = matrix[14];\n result[15] = matrix[15];\n\n return result;\n};\n\n/**\n * Computes the product of a matrix and a column vector.\n *\n * @param {Matrix4} matrix The matrix.\n * @param {Cartesian4} cartesian The vector.\n * @param {Cartesian4} result The object onto which to store the result.\n * @returns {Cartesian4} The modified result parameter.\n */\nMatrix4.multiplyByVector = function (matrix, cartesian, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"matrix\", matrix);\n Check.typeOf.object(\"cartesian\", cartesian);\n Check.typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n\n const vX = cartesian.x;\n const vY = cartesian.y;\n const vZ = cartesian.z;\n const vW = cartesian.w;\n\n const x = matrix[0] * vX + matrix[4] * vY + matrix[8] * vZ + matrix[12] * vW;\n const y = matrix[1] * vX + matrix[5] * vY + matrix[9] * vZ + matrix[13] * vW;\n const z = matrix[2] * vX + matrix[6] * vY + matrix[10] * vZ + matrix[14] * vW;\n const w = matrix[3] * vX + matrix[7] * vY + matrix[11] * vZ + matrix[15] * vW;\n\n result.x = x;\n result.y = y;\n result.z = z;\n result.w = w;\n return result;\n};\n\n/**\n * Computes the product of a matrix and a {@link Cartesian3}. This is equivalent to calling {@link Matrix4.multiplyByVector}\n * with a {@link Cartesian4} with a w
component of zero.\n *\n * @param {Matrix4} matrix The matrix.\n * @param {Cartesian3} cartesian The point.\n * @param {Cartesian3} result The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter.\n *\n * @example\n * const p = new Cesium.Cartesian3(1.0, 2.0, 3.0);\n * const result = Cesium.Matrix4.multiplyByPointAsVector(matrix, p, new Cesium.Cartesian3());\n * // A shortcut for\n * // Cartesian3 p = ...\n * // Cesium.Matrix4.multiplyByVector(matrix, new Cesium.Cartesian4(p.x, p.y, p.z, 0.0), result);\n */\nMatrix4.multiplyByPointAsVector = function (matrix, cartesian, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"matrix\", matrix);\n Check.typeOf.object(\"cartesian\", cartesian);\n Check.typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n\n const vX = cartesian.x;\n const vY = cartesian.y;\n const vZ = cartesian.z;\n\n const x = matrix[0] * vX + matrix[4] * vY + matrix[8] * vZ;\n const y = matrix[1] * vX + matrix[5] * vY + matrix[9] * vZ;\n const z = matrix[2] * vX + matrix[6] * vY + matrix[10] * vZ;\n\n result.x = x;\n result.y = y;\n result.z = z;\n return result;\n};\n\n/**\n * Computes the product of a matrix and a {@link Cartesian3}. This is equivalent to calling {@link Matrix4.multiplyByVector}\n * with a {@link Cartesian4} with a w
component of 1, but returns a {@link Cartesian3} instead of a {@link Cartesian4}.\n *\n * @param {Matrix4} matrix The matrix.\n * @param {Cartesian3} cartesian The point.\n * @param {Cartesian3} result The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter.\n *\n * @example\n * const p = new Cesium.Cartesian3(1.0, 2.0, 3.0);\n * const result = Cesium.Matrix4.multiplyByPoint(matrix, p, new Cesium.Cartesian3());\n */\nMatrix4.multiplyByPoint = function (matrix, cartesian, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"matrix\", matrix);\n Check.typeOf.object(\"cartesian\", cartesian);\n Check.typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n\n const vX = cartesian.x;\n const vY = cartesian.y;\n const vZ = cartesian.z;\n\n const x = matrix[0] * vX + matrix[4] * vY + matrix[8] * vZ + matrix[12];\n const y = matrix[1] * vX + matrix[5] * vY + matrix[9] * vZ + matrix[13];\n const z = matrix[2] * vX + matrix[6] * vY + matrix[10] * vZ + matrix[14];\n\n result.x = x;\n result.y = y;\n result.z = z;\n return result;\n};\n\n/**\n * Computes the product of a matrix and a scalar.\n *\n * @param {Matrix4} matrix The matrix.\n * @param {number} scalar The number to multiply by.\n * @param {Matrix4} result The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter.\n *\n * @example\n * //create a Matrix4 instance which is a scaled version of the supplied Matrix4\n * // m = [10.0, 11.0, 12.0, 13.0]\n * // [14.0, 15.0, 16.0, 17.0]\n * // [18.0, 19.0, 20.0, 21.0]\n * // [22.0, 23.0, 24.0, 25.0]\n *\n * const a = Cesium.Matrix4.multiplyByScalar(m, -2, new Cesium.Matrix4());\n *\n * // m remains the same\n * // a = [-20.0, -22.0, -24.0, -26.0]\n * // [-28.0, -30.0, -32.0, -34.0]\n * // [-36.0, -38.0, -40.0, -42.0]\n * // [-44.0, -46.0, -48.0, -50.0]\n */\nMatrix4.multiplyByScalar = function (matrix, scalar, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"matrix\", matrix);\n Check.typeOf.number(\"scalar\", scalar);\n Check.typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n\n result[0] = matrix[0] * scalar;\n result[1] = matrix[1] * scalar;\n result[2] = matrix[2] * scalar;\n result[3] = matrix[3] * scalar;\n result[4] = matrix[4] * scalar;\n result[5] = matrix[5] * scalar;\n result[6] = matrix[6] * scalar;\n result[7] = matrix[7] * scalar;\n result[8] = matrix[8] * scalar;\n result[9] = matrix[9] * scalar;\n result[10] = matrix[10] * scalar;\n result[11] = matrix[11] * scalar;\n result[12] = matrix[12] * scalar;\n result[13] = matrix[13] * scalar;\n result[14] = matrix[14] * scalar;\n result[15] = matrix[15] * scalar;\n return result;\n};\n\n/**\n * Computes a negated copy of the provided matrix.\n *\n * @param {Matrix4} matrix The matrix to negate.\n * @param {Matrix4} result The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter.\n *\n * @example\n * //create a new Matrix4 instance which is a negation of a Matrix4\n * // m = [10.0, 11.0, 12.0, 13.0]\n * // [14.0, 15.0, 16.0, 17.0]\n * // [18.0, 19.0, 20.0, 21.0]\n * // [22.0, 23.0, 24.0, 25.0]\n *\n * const a = Cesium.Matrix4.negate(m, new Cesium.Matrix4());\n *\n * // m remains the same\n * // a = [-10.0, -11.0, -12.0, -13.0]\n * // [-14.0, -15.0, -16.0, -17.0]\n * // [-18.0, -19.0, -20.0, -21.0]\n * // [-22.0, -23.0, -24.0, -25.0]\n */\nMatrix4.negate = function (matrix, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"matrix\", matrix);\n Check.typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n\n result[0] = -matrix[0];\n result[1] = -matrix[1];\n result[2] = -matrix[2];\n result[3] = -matrix[3];\n result[4] = -matrix[4];\n result[5] = -matrix[5];\n result[6] = -matrix[6];\n result[7] = -matrix[7];\n result[8] = -matrix[8];\n result[9] = -matrix[9];\n result[10] = -matrix[10];\n result[11] = -matrix[11];\n result[12] = -matrix[12];\n result[13] = -matrix[13];\n result[14] = -matrix[14];\n result[15] = -matrix[15];\n return result;\n};\n\n/**\n * Computes the transpose of the provided matrix.\n *\n * @param {Matrix4} matrix The matrix to transpose.\n * @param {Matrix4} result The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter.\n *\n * @example\n * //returns transpose of a Matrix4\n * // m = [10.0, 11.0, 12.0, 13.0]\n * // [14.0, 15.0, 16.0, 17.0]\n * // [18.0, 19.0, 20.0, 21.0]\n * // [22.0, 23.0, 24.0, 25.0]\n *\n * const a = Cesium.Matrix4.transpose(m, new Cesium.Matrix4());\n *\n * // m remains the same\n * // a = [10.0, 14.0, 18.0, 22.0]\n * // [11.0, 15.0, 19.0, 23.0]\n * // [12.0, 16.0, 20.0, 24.0]\n * // [13.0, 17.0, 21.0, 25.0]\n */\nMatrix4.transpose = function (matrix, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"matrix\", matrix);\n Check.typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n\n const matrix1 = matrix[1];\n const matrix2 = matrix[2];\n const matrix3 = matrix[3];\n const matrix6 = matrix[6];\n const matrix7 = matrix[7];\n const matrix11 = matrix[11];\n\n result[0] = matrix[0];\n result[1] = matrix[4];\n result[2] = matrix[8];\n result[3] = matrix[12];\n result[4] = matrix1;\n result[5] = matrix[5];\n result[6] = matrix[9];\n result[7] = matrix[13];\n result[8] = matrix2;\n result[9] = matrix6;\n result[10] = matrix[10];\n result[11] = matrix[14];\n result[12] = matrix3;\n result[13] = matrix7;\n result[14] = matrix11;\n result[15] = matrix[15];\n return result;\n};\n\n/**\n * Computes a matrix, which contains the absolute (unsigned) values of the provided matrix's elements.\n *\n * @param {Matrix4} matrix The matrix with signed elements.\n * @param {Matrix4} result The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter.\n */\nMatrix4.abs = function (matrix, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"matrix\", matrix);\n Check.typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n\n result[0] = Math.abs(matrix[0]);\n result[1] = Math.abs(matrix[1]);\n result[2] = Math.abs(matrix[2]);\n result[3] = Math.abs(matrix[3]);\n result[4] = Math.abs(matrix[4]);\n result[5] = Math.abs(matrix[5]);\n result[6] = Math.abs(matrix[6]);\n result[7] = Math.abs(matrix[7]);\n result[8] = Math.abs(matrix[8]);\n result[9] = Math.abs(matrix[9]);\n result[10] = Math.abs(matrix[10]);\n result[11] = Math.abs(matrix[11]);\n result[12] = Math.abs(matrix[12]);\n result[13] = Math.abs(matrix[13]);\n result[14] = Math.abs(matrix[14]);\n result[15] = Math.abs(matrix[15]);\n\n return result;\n};\n\n/**\n * Compares the provided matrices componentwise and returns\n * true
if they are equal, false
otherwise.\n *\n * @param {Matrix4} [left] The first matrix.\n * @param {Matrix4} [right] The second matrix.\n * @returns {boolean} true
if left and right are equal, false
otherwise.\n *\n * @example\n * //compares two Matrix4 instances\n *\n * // a = [10.0, 14.0, 18.0, 22.0]\n * // [11.0, 15.0, 19.0, 23.0]\n * // [12.0, 16.0, 20.0, 24.0]\n * // [13.0, 17.0, 21.0, 25.0]\n *\n * // b = [10.0, 14.0, 18.0, 22.0]\n * // [11.0, 15.0, 19.0, 23.0]\n * // [12.0, 16.0, 20.0, 24.0]\n * // [13.0, 17.0, 21.0, 25.0]\n *\n * if(Cesium.Matrix4.equals(a,b)) {\n * console.log(\"Both matrices are equal\");\n * } else {\n * console.log(\"They are not equal\");\n * }\n *\n * //Prints \"Both matrices are equal\" on the console\n */\nMatrix4.equals = function (left, right) {\n // Given that most matrices will be transformation matrices, the elements\n // are tested in order such that the test is likely to fail as early\n // as possible. I _think_ this is just as friendly to the L1 cache\n // as testing in index order. It is certainty faster in practice.\n return (\n left === right ||\n (defined(left) &&\n defined(right) &&\n // Translation\n left[12] === right[12] &&\n left[13] === right[13] &&\n left[14] === right[14] &&\n // Rotation/scale\n left[0] === right[0] &&\n left[1] === right[1] &&\n left[2] === right[2] &&\n left[4] === right[4] &&\n left[5] === right[5] &&\n left[6] === right[6] &&\n left[8] === right[8] &&\n left[9] === right[9] &&\n left[10] === right[10] &&\n // Bottom row\n left[3] === right[3] &&\n left[7] === right[7] &&\n left[11] === right[11] &&\n left[15] === right[15])\n );\n};\n\n/**\n * Compares the provided matrices componentwise and returns\n * true
if they are within the provided epsilon,\n * false
otherwise.\n *\n * @param {Matrix4} [left] The first matrix.\n * @param {Matrix4} [right] The second matrix.\n * @param {number} [epsilon=0] The epsilon to use for equality testing.\n * @returns {boolean} true
if left and right are within the provided epsilon, false
otherwise.\n *\n * @example\n * //compares two Matrix4 instances\n *\n * // a = [10.5, 14.5, 18.5, 22.5]\n * // [11.5, 15.5, 19.5, 23.5]\n * // [12.5, 16.5, 20.5, 24.5]\n * // [13.5, 17.5, 21.5, 25.5]\n *\n * // b = [10.0, 14.0, 18.0, 22.0]\n * // [11.0, 15.0, 19.0, 23.0]\n * // [12.0, 16.0, 20.0, 24.0]\n * // [13.0, 17.0, 21.0, 25.0]\n *\n * if(Cesium.Matrix4.equalsEpsilon(a,b,0.1)){\n * console.log(\"Difference between both the matrices is less than 0.1\");\n * } else {\n * console.log(\"Difference between both the matrices is not less than 0.1\");\n * }\n *\n * //Prints \"Difference between both the matrices is not less than 0.1\" on the console\n */\nMatrix4.equalsEpsilon = function (left, right, epsilon) {\n epsilon = defaultValue(epsilon, 0);\n\n return (\n left === right ||\n (defined(left) &&\n defined(right) &&\n Math.abs(left[0] - right[0]) <= epsilon &&\n Math.abs(left[1] - right[1]) <= epsilon &&\n Math.abs(left[2] - right[2]) <= epsilon &&\n Math.abs(left[3] - right[3]) <= epsilon &&\n Math.abs(left[4] - right[4]) <= epsilon &&\n Math.abs(left[5] - right[5]) <= epsilon &&\n Math.abs(left[6] - right[6]) <= epsilon &&\n Math.abs(left[7] - right[7]) <= epsilon &&\n Math.abs(left[8] - right[8]) <= epsilon &&\n Math.abs(left[9] - right[9]) <= epsilon &&\n Math.abs(left[10] - right[10]) <= epsilon &&\n Math.abs(left[11] - right[11]) <= epsilon &&\n Math.abs(left[12] - right[12]) <= epsilon &&\n Math.abs(left[13] - right[13]) <= epsilon &&\n Math.abs(left[14] - right[14]) <= epsilon &&\n Math.abs(left[15] - right[15]) <= epsilon)\n );\n};\n\n/**\n * Gets the translation portion of the provided matrix, assuming the matrix is an affine transformation matrix.\n *\n * @param {Matrix4} matrix The matrix to use.\n * @param {Cartesian3} result The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter.\n */\nMatrix4.getTranslation = function (matrix, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"matrix\", matrix);\n Check.typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n\n result.x = matrix[12];\n result.y = matrix[13];\n result.z = matrix[14];\n return result;\n};\n\n/**\n * Gets the upper left 3x3 matrix of the provided matrix.\n *\n * @param {Matrix4} matrix The matrix to use.\n * @param {Matrix3} result The object onto which to store the result.\n * @returns {Matrix3} The modified result parameter.\n *\n * @example\n * // returns a Matrix3 instance from a Matrix4 instance\n *\n * // m = [10.0, 14.0, 18.0, 22.0]\n * // [11.0, 15.0, 19.0, 23.0]\n * // [12.0, 16.0, 20.0, 24.0]\n * // [13.0, 17.0, 21.0, 25.0]\n *\n * const b = new Cesium.Matrix3();\n * Cesium.Matrix4.getMatrix3(m,b);\n *\n * // b = [10.0, 14.0, 18.0]\n * // [11.0, 15.0, 19.0]\n * // [12.0, 16.0, 20.0]\n */\nMatrix4.getMatrix3 = function (matrix, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"matrix\", matrix);\n Check.typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n\n result[0] = matrix[0];\n result[1] = matrix[1];\n result[2] = matrix[2];\n result[3] = matrix[4];\n result[4] = matrix[5];\n result[5] = matrix[6];\n result[6] = matrix[8];\n result[7] = matrix[9];\n result[8] = matrix[10];\n return result;\n};\n\nconst scratchInverseRotation = new Matrix3();\nconst scratchMatrix3Zero = new Matrix3();\nconst scratchBottomRow = new Cartesian4();\nconst scratchExpectedBottomRow = new Cartesian4(0.0, 0.0, 0.0, 1.0);\n\n/**\n * Computes the inverse of the provided matrix using Cramers Rule.\n * If the determinant is zero, the matrix can not be inverted, and an exception is thrown.\n * If the matrix is a proper rigid transformation, it is more efficient\n * to invert it with {@link Matrix4.inverseTransformation}.\n *\n * @param {Matrix4} matrix The matrix to invert.\n * @param {Matrix4} result The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter.\n *\n * @exception {RuntimeError} matrix is not invertible because its determinate is zero.\n */\nMatrix4.inverse = function (matrix, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"matrix\", matrix);\n Check.typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n //\n // Ported from:\n // ftp://download.intel.com/design/PentiumIII/sml/24504301.pdf\n //\n const src0 = matrix[0];\n const src1 = matrix[4];\n const src2 = matrix[8];\n const src3 = matrix[12];\n const src4 = matrix[1];\n const src5 = matrix[5];\n const src6 = matrix[9];\n const src7 = matrix[13];\n const src8 = matrix[2];\n const src9 = matrix[6];\n const src10 = matrix[10];\n const src11 = matrix[14];\n const src12 = matrix[3];\n const src13 = matrix[7];\n const src14 = matrix[11];\n const src15 = matrix[15];\n\n // calculate pairs for first 8 elements (cofactors)\n let tmp0 = src10 * src15;\n let tmp1 = src11 * src14;\n let tmp2 = src9 * src15;\n let tmp3 = src11 * src13;\n let tmp4 = src9 * src14;\n let tmp5 = src10 * src13;\n let tmp6 = src8 * src15;\n let tmp7 = src11 * src12;\n let tmp8 = src8 * src14;\n let tmp9 = src10 * src12;\n let tmp10 = src8 * src13;\n let tmp11 = src9 * src12;\n\n // calculate first 8 elements (cofactors)\n const dst0 =\n tmp0 * src5 +\n tmp3 * src6 +\n tmp4 * src7 -\n (tmp1 * src5 + tmp2 * src6 + tmp5 * src7);\n const dst1 =\n tmp1 * src4 +\n tmp6 * src6 +\n tmp9 * src7 -\n (tmp0 * src4 + tmp7 * src6 + tmp8 * src7);\n const dst2 =\n tmp2 * src4 +\n tmp7 * src5 +\n tmp10 * src7 -\n (tmp3 * src4 + tmp6 * src5 + tmp11 * src7);\n const dst3 =\n tmp5 * src4 +\n tmp8 * src5 +\n tmp11 * src6 -\n (tmp4 * src4 + tmp9 * src5 + tmp10 * src6);\n const dst4 =\n tmp1 * src1 +\n tmp2 * src2 +\n tmp5 * src3 -\n (tmp0 * src1 + tmp3 * src2 + tmp4 * src3);\n const dst5 =\n tmp0 * src0 +\n tmp7 * src2 +\n tmp8 * src3 -\n (tmp1 * src0 + tmp6 * src2 + tmp9 * src3);\n const dst6 =\n tmp3 * src0 +\n tmp6 * src1 +\n tmp11 * src3 -\n (tmp2 * src0 + tmp7 * src1 + tmp10 * src3);\n const dst7 =\n tmp4 * src0 +\n tmp9 * src1 +\n tmp10 * src2 -\n (tmp5 * src0 + tmp8 * src1 + tmp11 * src2);\n\n // calculate pairs for second 8 elements (cofactors)\n tmp0 = src2 * src7;\n tmp1 = src3 * src6;\n tmp2 = src1 * src7;\n tmp3 = src3 * src5;\n tmp4 = src1 * src6;\n tmp5 = src2 * src5;\n tmp6 = src0 * src7;\n tmp7 = src3 * src4;\n tmp8 = src0 * src6;\n tmp9 = src2 * src4;\n tmp10 = src0 * src5;\n tmp11 = src1 * src4;\n\n // calculate second 8 elements (cofactors)\n const dst8 =\n tmp0 * src13 +\n tmp3 * src14 +\n tmp4 * src15 -\n (tmp1 * src13 + tmp2 * src14 + tmp5 * src15);\n const dst9 =\n tmp1 * src12 +\n tmp6 * src14 +\n tmp9 * src15 -\n (tmp0 * src12 + tmp7 * src14 + tmp8 * src15);\n const dst10 =\n tmp2 * src12 +\n tmp7 * src13 +\n tmp10 * src15 -\n (tmp3 * src12 + tmp6 * src13 + tmp11 * src15);\n const dst11 =\n tmp5 * src12 +\n tmp8 * src13 +\n tmp11 * src14 -\n (tmp4 * src12 + tmp9 * src13 + tmp10 * src14);\n const dst12 =\n tmp2 * src10 +\n tmp5 * src11 +\n tmp1 * src9 -\n (tmp4 * src11 + tmp0 * src9 + tmp3 * src10);\n const dst13 =\n tmp8 * src11 +\n tmp0 * src8 +\n tmp7 * src10 -\n (tmp6 * src10 + tmp9 * src11 + tmp1 * src8);\n const dst14 =\n tmp6 * src9 +\n tmp11 * src11 +\n tmp3 * src8 -\n (tmp10 * src11 + tmp2 * src8 + tmp7 * src9);\n const dst15 =\n tmp10 * src10 +\n tmp4 * src8 +\n tmp9 * src9 -\n (tmp8 * src9 + tmp11 * src10 + tmp5 * src8);\n\n // calculate determinant\n let det = src0 * dst0 + src1 * dst1 + src2 * dst2 + src3 * dst3;\n\n if (Math.abs(det) < CesiumMath.EPSILON21) {\n // Special case for a zero scale matrix that can occur, for example,\n // when a model's node has a [0, 0, 0] scale.\n if (\n Matrix3.equalsEpsilon(\n Matrix4.getMatrix3(matrix, scratchInverseRotation),\n scratchMatrix3Zero,\n CesiumMath.EPSILON7,\n ) &&\n Cartesian4.equals(\n Matrix4.getRow(matrix, 3, scratchBottomRow),\n scratchExpectedBottomRow,\n )\n ) {\n result[0] = 0.0;\n result[1] = 0.0;\n result[2] = 0.0;\n result[3] = 0.0;\n result[4] = 0.0;\n result[5] = 0.0;\n result[6] = 0.0;\n result[7] = 0.0;\n result[8] = 0.0;\n result[9] = 0.0;\n result[10] = 0.0;\n result[11] = 0.0;\n result[12] = -matrix[12];\n result[13] = -matrix[13];\n result[14] = -matrix[14];\n result[15] = 1.0;\n return result;\n }\n\n throw new RuntimeError(\n \"matrix is not invertible because its determinate is zero.\",\n );\n }\n\n // calculate matrix inverse\n det = 1.0 / det;\n\n result[0] = dst0 * det;\n result[1] = dst1 * det;\n result[2] = dst2 * det;\n result[3] = dst3 * det;\n result[4] = dst4 * det;\n result[5] = dst5 * det;\n result[6] = dst6 * det;\n result[7] = dst7 * det;\n result[8] = dst8 * det;\n result[9] = dst9 * det;\n result[10] = dst10 * det;\n result[11] = dst11 * det;\n result[12] = dst12 * det;\n result[13] = dst13 * det;\n result[14] = dst14 * det;\n result[15] = dst15 * det;\n return result;\n};\n\n/**\n * Computes the inverse of the provided matrix assuming it is a proper rigid matrix,\n * where the upper left 3x3 elements are a rotation matrix,\n * and the upper three elements in the fourth column are the translation.\n * The bottom row is assumed to be [0, 0, 0, 1].\n * The matrix is not verified to be in the proper form.\n * This method is faster than computing the inverse for a general 4x4\n * matrix using {@link Matrix4.inverse}.\n *\n * @param {Matrix4} matrix The matrix to invert.\n * @param {Matrix4} result The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter.\n */\nMatrix4.inverseTransformation = function (matrix, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"matrix\", matrix);\n Check.typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n\n //This function is an optimized version of the below 4 lines.\n //const rT = Matrix3.transpose(Matrix4.getMatrix3(matrix));\n //const rTN = Matrix3.negate(rT);\n //const rTT = Matrix3.multiplyByVector(rTN, Matrix4.getTranslation(matrix));\n //return Matrix4.fromRotationTranslation(rT, rTT, result);\n\n const matrix0 = matrix[0];\n const matrix1 = matrix[1];\n const matrix2 = matrix[2];\n const matrix4 = matrix[4];\n const matrix5 = matrix[5];\n const matrix6 = matrix[6];\n const matrix8 = matrix[8];\n const matrix9 = matrix[9];\n const matrix10 = matrix[10];\n\n const vX = matrix[12];\n const vY = matrix[13];\n const vZ = matrix[14];\n\n const x = -matrix0 * vX - matrix1 * vY - matrix2 * vZ;\n const y = -matrix4 * vX - matrix5 * vY - matrix6 * vZ;\n const z = -matrix8 * vX - matrix9 * vY - matrix10 * vZ;\n\n result[0] = matrix0;\n result[1] = matrix4;\n result[2] = matrix8;\n result[3] = 0.0;\n result[4] = matrix1;\n result[5] = matrix5;\n result[6] = matrix9;\n result[7] = 0.0;\n result[8] = matrix2;\n result[9] = matrix6;\n result[10] = matrix10;\n result[11] = 0.0;\n result[12] = x;\n result[13] = y;\n result[14] = z;\n result[15] = 1.0;\n return result;\n};\n\nconst scratchTransposeMatrix = new Matrix4();\n\n/**\n * Computes the inverse transpose of a matrix.\n *\n * @param {Matrix4} matrix The matrix to transpose and invert.\n * @param {Matrix4} result The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter.\n */\nMatrix4.inverseTranspose = function (matrix, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"matrix\", matrix);\n Check.typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n\n return Matrix4.inverse(\n Matrix4.transpose(matrix, scratchTransposeMatrix),\n result,\n );\n};\n\n/**\n * An immutable Matrix4 instance initialized to the identity matrix.\n *\n * @type {Matrix4}\n * @constant\n */\nMatrix4.IDENTITY = Object.freeze(\n new Matrix4(\n 1.0,\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n 1.0,\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n 1.0,\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n 1.0,\n ),\n);\n\n/**\n * An immutable Matrix4 instance initialized to the zero matrix.\n *\n * @type {Matrix4}\n * @constant\n */\nMatrix4.ZERO = Object.freeze(\n new Matrix4(\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n ),\n);\n\n/**\n * The index into Matrix4 for column 0, row 0.\n *\n * @type {number}\n * @constant\n */\nMatrix4.COLUMN0ROW0 = 0;\n\n/**\n * The index into Matrix4 for column 0, row 1.\n *\n * @type {number}\n * @constant\n */\nMatrix4.COLUMN0ROW1 = 1;\n\n/**\n * The index into Matrix4 for column 0, row 2.\n *\n * @type {number}\n * @constant\n */\nMatrix4.COLUMN0ROW2 = 2;\n\n/**\n * The index into Matrix4 for column 0, row 3.\n *\n * @type {number}\n * @constant\n */\nMatrix4.COLUMN0ROW3 = 3;\n\n/**\n * The index into Matrix4 for column 1, row 0.\n *\n * @type {number}\n * @constant\n */\nMatrix4.COLUMN1ROW0 = 4;\n\n/**\n * The index into Matrix4 for column 1, row 1.\n *\n * @type {number}\n * @constant\n */\nMatrix4.COLUMN1ROW1 = 5;\n\n/**\n * The index into Matrix4 for column 1, row 2.\n *\n * @type {number}\n * @constant\n */\nMatrix4.COLUMN1ROW2 = 6;\n\n/**\n * The index into Matrix4 for column 1, row 3.\n *\n * @type {number}\n * @constant\n */\nMatrix4.COLUMN1ROW3 = 7;\n\n/**\n * The index into Matrix4 for column 2, row 0.\n *\n * @type {number}\n * @constant\n */\nMatrix4.COLUMN2ROW0 = 8;\n\n/**\n * The index into Matrix4 for column 2, row 1.\n *\n * @type {number}\n * @constant\n */\nMatrix4.COLUMN2ROW1 = 9;\n\n/**\n * The index into Matrix4 for column 2, row 2.\n *\n * @type {number}\n * @constant\n */\nMatrix4.COLUMN2ROW2 = 10;\n\n/**\n * The index into Matrix4 for column 2, row 3.\n *\n * @type {number}\n * @constant\n */\nMatrix4.COLUMN2ROW3 = 11;\n\n/**\n * The index into Matrix4 for column 3, row 0.\n *\n * @type {number}\n * @constant\n */\nMatrix4.COLUMN3ROW0 = 12;\n\n/**\n * The index into Matrix4 for column 3, row 1.\n *\n * @type {number}\n * @constant\n */\nMatrix4.COLUMN3ROW1 = 13;\n\n/**\n * The index into Matrix4 for column 3, row 2.\n *\n * @type {number}\n * @constant\n */\nMatrix4.COLUMN3ROW2 = 14;\n\n/**\n * The index into Matrix4 for column 3, row 3.\n *\n * @type {number}\n * @constant\n */\nMatrix4.COLUMN3ROW3 = 15;\n\nObject.defineProperties(Matrix4.prototype, {\n /**\n * Gets the number of items in the collection.\n * @memberof Matrix4.prototype\n *\n * @type {number}\n */\n length: {\n get: function () {\n return Matrix4.packedLength;\n },\n },\n});\n\n/**\n * Duplicates the provided Matrix4 instance.\n *\n * @param {Matrix4} [result] The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter or a new Matrix4 instance if one was not provided.\n */\nMatrix4.prototype.clone = function (result) {\n return Matrix4.clone(this, result);\n};\n\n/**\n * Compares this matrix to the provided matrix componentwise and returns\n * true
if they are equal, false
otherwise.\n *\n * @param {Matrix4} [right] The right hand side matrix.\n * @returns {boolean} true
if they are equal, false
otherwise.\n */\nMatrix4.prototype.equals = function (right) {\n return Matrix4.equals(this, right);\n};\n\n/**\n * @private\n */\nMatrix4.equalsArray = function (matrix, array, offset) {\n return (\n matrix[0] === array[offset] &&\n matrix[1] === array[offset + 1] &&\n matrix[2] === array[offset + 2] &&\n matrix[3] === array[offset + 3] &&\n matrix[4] === array[offset + 4] &&\n matrix[5] === array[offset + 5] &&\n matrix[6] === array[offset + 6] &&\n matrix[7] === array[offset + 7] &&\n matrix[8] === array[offset + 8] &&\n matrix[9] === array[offset + 9] &&\n matrix[10] === array[offset + 10] &&\n matrix[11] === array[offset + 11] &&\n matrix[12] === array[offset + 12] &&\n matrix[13] === array[offset + 13] &&\n matrix[14] === array[offset + 14] &&\n matrix[15] === array[offset + 15]\n );\n};\n\n/**\n * Compares this matrix to the provided matrix componentwise and returns\n * true
if they are within the provided epsilon,\n * false
otherwise.\n *\n * @param {Matrix4} [right] The right hand side matrix.\n * @param {number} [epsilon=0] The epsilon to use for equality testing.\n * @returns {boolean} true
if they are within the provided epsilon, false
otherwise.\n */\nMatrix4.prototype.equalsEpsilon = function (right, epsilon) {\n return Matrix4.equalsEpsilon(this, right, epsilon);\n};\n\n/**\n * Computes a string representing this Matrix with each row being\n * on a separate line and in the format '(column0, column1, column2, column3)'.\n *\n * @returns {string} A string representing the provided Matrix with each row being on a separate line and in the format '(column0, column1, column2, column3)'.\n */\nMatrix4.prototype.toString = function () {\n return (\n `(${this[0]}, ${this[4]}, ${this[8]}, ${this[12]})\\n` +\n `(${this[1]}, ${this[5]}, ${this[9]}, ${this[13]})\\n` +\n `(${this[2]}, ${this[6]}, ${this[10]}, ${this[14]})\\n` +\n `(${this[3]}, ${this[7]}, ${this[11]}, ${this[15]})`\n );\n};\nexport default Matrix4;\n","import Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport CesiumMath from \"./Math.js\";\n\n/**\n * A 4D Cartesian point.\n * @alias Cartesian4\n * @constructor\n *\n * @param {number} [x=0.0] The X component.\n * @param {number} [y=0.0] The Y component.\n * @param {number} [z=0.0] The Z component.\n * @param {number} [w=0.0] The W component.\n *\n * @see Cartesian2\n * @see Cartesian3\n * @see Packable\n */\nfunction Cartesian4(x, y, z, w) {\n /**\n * The X component.\n * @type {number}\n * @default 0.0\n */\n this.x = defaultValue(x, 0.0);\n\n /**\n * The Y component.\n * @type {number}\n * @default 0.0\n */\n this.y = defaultValue(y, 0.0);\n\n /**\n * The Z component.\n * @type {number}\n * @default 0.0\n */\n this.z = defaultValue(z, 0.0);\n\n /**\n * The W component.\n * @type {number}\n * @default 0.0\n */\n this.w = defaultValue(w, 0.0);\n}\n\n/**\n * Creates a Cartesian4 instance from x, y, z and w coordinates.\n *\n * @param {number} x The x coordinate.\n * @param {number} y The y coordinate.\n * @param {number} z The z coordinate.\n * @param {number} w The w coordinate.\n * @param {Cartesian4} [result] The object onto which to store the result.\n * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided.\n */\nCartesian4.fromElements = function (x, y, z, w, result) {\n if (!defined(result)) {\n return new Cartesian4(x, y, z, w);\n }\n\n result.x = x;\n result.y = y;\n result.z = z;\n result.w = w;\n return result;\n};\n\n/**\n * Creates a Cartesian4 instance from a {@link Color}. red
, green
, blue
,\n * and alpha
map to x
, y
, z
, and w
, respectively.\n *\n * @param {Color} color The source color.\n * @param {Cartesian4} [result] The object onto which to store the result.\n * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided.\n */\nCartesian4.fromColor = function (color, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"color\", color);\n //>>includeEnd('debug');\n if (!defined(result)) {\n return new Cartesian4(color.red, color.green, color.blue, color.alpha);\n }\n\n result.x = color.red;\n result.y = color.green;\n result.z = color.blue;\n result.w = color.alpha;\n return result;\n};\n\n/**\n * Duplicates a Cartesian4 instance.\n *\n * @param {Cartesian4} cartesian The Cartesian to duplicate.\n * @param {Cartesian4} [result] The object onto which to store the result.\n * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided. (Returns undefined if cartesian is undefined)\n */\nCartesian4.clone = function (cartesian, result) {\n if (!defined(cartesian)) {\n return undefined;\n }\n\n if (!defined(result)) {\n return new Cartesian4(cartesian.x, cartesian.y, cartesian.z, cartesian.w);\n }\n\n result.x = cartesian.x;\n result.y = cartesian.y;\n result.z = cartesian.z;\n result.w = cartesian.w;\n return result;\n};\n\n/**\n * The number of elements used to pack the object into an array.\n * @type {number}\n */\nCartesian4.packedLength = 4;\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {Cartesian4} value The value to pack.\n * @param {number[]} array The array to pack into.\n * @param {number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {number[]} The array that was packed into\n */\nCartesian4.pack = function (value, array, startingIndex) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"value\", value);\n Check.defined(\"array\", array);\n //>>includeEnd('debug');\n\n startingIndex = defaultValue(startingIndex, 0);\n\n array[startingIndex++] = value.x;\n array[startingIndex++] = value.y;\n array[startingIndex++] = value.z;\n array[startingIndex] = value.w;\n\n return array;\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {number[]} array The packed array.\n * @param {number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {Cartesian4} [result] The object into which to store the result.\n * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided.\n */\nCartesian4.unpack = function (array, startingIndex, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.defined(\"array\", array);\n //>>includeEnd('debug');\n\n startingIndex = defaultValue(startingIndex, 0);\n\n if (!defined(result)) {\n result = new Cartesian4();\n }\n result.x = array[startingIndex++];\n result.y = array[startingIndex++];\n result.z = array[startingIndex++];\n result.w = array[startingIndex];\n return result;\n};\n\n/**\n * Flattens an array of Cartesian4s into an array of components.\n *\n * @param {Cartesian4[]} array The array of cartesians to pack.\n * @param {number[]} [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.\n * @returns {number[]} The packed array.\n */\nCartesian4.packArray = function (array, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.defined(\"array\", array);\n //>>includeEnd('debug');\n\n const length = array.length;\n const resultLength = length * 4;\n if (!defined(result)) {\n result = new Array(resultLength);\n } else if (!Array.isArray(result) && result.length !== resultLength) {\n //>>includeStart('debug', pragmas.debug);\n throw new DeveloperError(\n \"If result is a typed array, it must have exactly array.length * 4 elements\",\n );\n //>>includeEnd('debug');\n } else if (result.length !== resultLength) {\n result.length = resultLength;\n }\n\n for (let i = 0; i < length; ++i) {\n Cartesian4.pack(array[i], result, i * 4);\n }\n return result;\n};\n\n/**\n * Unpacks an array of cartesian components into an array of Cartesian4s.\n *\n * @param {number[]} array The array of components to unpack.\n * @param {Cartesian4[]} [result] The array onto which to store the result.\n * @returns {Cartesian4[]} The unpacked array.\n */\nCartesian4.unpackArray = function (array, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.defined(\"array\", array);\n Check.typeOf.number.greaterThanOrEquals(\"array.length\", array.length, 4);\n if (array.length % 4 !== 0) {\n throw new DeveloperError(\"array length must be a multiple of 4.\");\n }\n //>>includeEnd('debug');\n\n const length = array.length;\n if (!defined(result)) {\n result = new Array(length / 4);\n } else {\n result.length = length / 4;\n }\n\n for (let i = 0; i < length; i += 4) {\n const index = i / 4;\n result[index] = Cartesian4.unpack(array, i, result[index]);\n }\n return result;\n};\n\n/**\n * Creates a Cartesian4 from four consecutive elements in an array.\n * @function\n *\n * @param {number[]} array The array whose four consecutive elements correspond to the x, y, z, and w components, respectively.\n * @param {number} [startingIndex=0] The offset into the array of the first element, which corresponds to the x component.\n * @param {Cartesian4} [result] The object onto which to store the result.\n * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided.\n *\n * @example\n * // Create a Cartesian4 with (1.0, 2.0, 3.0, 4.0)\n * const v = [1.0, 2.0, 3.0, 4.0];\n * const p = Cesium.Cartesian4.fromArray(v);\n *\n * // Create a Cartesian4 with (1.0, 2.0, 3.0, 4.0) using an offset into an array\n * const v2 = [0.0, 0.0, 1.0, 2.0, 3.0, 4.0];\n * const p2 = Cesium.Cartesian4.fromArray(v2, 2);\n */\nCartesian4.fromArray = Cartesian4.unpack;\n\n/**\n * Computes the value of the maximum component for the supplied Cartesian.\n *\n * @param {Cartesian4} cartesian The cartesian to use.\n * @returns {number} The value of the maximum component.\n */\nCartesian4.maximumComponent = function (cartesian) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"cartesian\", cartesian);\n //>>includeEnd('debug');\n\n return Math.max(cartesian.x, cartesian.y, cartesian.z, cartesian.w);\n};\n\n/**\n * Computes the value of the minimum component for the supplied Cartesian.\n *\n * @param {Cartesian4} cartesian The cartesian to use.\n * @returns {number} The value of the minimum component.\n */\nCartesian4.minimumComponent = function (cartesian) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"cartesian\", cartesian);\n //>>includeEnd('debug');\n\n return Math.min(cartesian.x, cartesian.y, cartesian.z, cartesian.w);\n};\n\n/**\n * Compares two Cartesians and computes a Cartesian which contains the minimum components of the supplied Cartesians.\n *\n * @param {Cartesian4} first A cartesian to compare.\n * @param {Cartesian4} second A cartesian to compare.\n * @param {Cartesian4} result The object into which to store the result.\n * @returns {Cartesian4} A cartesian with the minimum components.\n */\nCartesian4.minimumByComponent = function (first, second, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"first\", first);\n Check.typeOf.object(\"second\", second);\n Check.typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n\n result.x = Math.min(first.x, second.x);\n result.y = Math.min(first.y, second.y);\n result.z = Math.min(first.z, second.z);\n result.w = Math.min(first.w, second.w);\n\n return result;\n};\n\n/**\n * Compares two Cartesians and computes a Cartesian which contains the maximum components of the supplied Cartesians.\n *\n * @param {Cartesian4} first A cartesian to compare.\n * @param {Cartesian4} second A cartesian to compare.\n * @param {Cartesian4} result The object into which to store the result.\n * @returns {Cartesian4} A cartesian with the maximum components.\n */\nCartesian4.maximumByComponent = function (first, second, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"first\", first);\n Check.typeOf.object(\"second\", second);\n Check.typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n\n result.x = Math.max(first.x, second.x);\n result.y = Math.max(first.y, second.y);\n result.z = Math.max(first.z, second.z);\n result.w = Math.max(first.w, second.w);\n\n return result;\n};\n\n/**\n * Constrain a value to lie between two values.\n *\n * @param {Cartesian4} value The value to clamp.\n * @param {Cartesian4} min The minimum bound.\n * @param {Cartesian4} max The maximum bound.\n * @param {Cartesian4} result The object into which to store the result.\n * @returns {Cartesian4} The clamped value such that min <= result <= max.\n */\nCartesian4.clamp = function (value, min, max, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"value\", value);\n Check.typeOf.object(\"min\", min);\n Check.typeOf.object(\"max\", max);\n Check.typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n\n const x = CesiumMath.clamp(value.x, min.x, max.x);\n const y = CesiumMath.clamp(value.y, min.y, max.y);\n const z = CesiumMath.clamp(value.z, min.z, max.z);\n const w = CesiumMath.clamp(value.w, min.w, max.w);\n\n result.x = x;\n result.y = y;\n result.z = z;\n result.w = w;\n\n return result;\n};\n\n/**\n * Computes the provided Cartesian's squared magnitude.\n *\n * @param {Cartesian4} cartesian The Cartesian instance whose squared magnitude is to be computed.\n * @returns {number} The squared magnitude.\n */\nCartesian4.magnitudeSquared = function (cartesian) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"cartesian\", cartesian);\n //>>includeEnd('debug');\n\n return (\n cartesian.x * cartesian.x +\n cartesian.y * cartesian.y +\n cartesian.z * cartesian.z +\n cartesian.w * cartesian.w\n );\n};\n\n/**\n * Computes the Cartesian's magnitude (length).\n *\n * @param {Cartesian4} cartesian The Cartesian instance whose magnitude is to be computed.\n * @returns {number} The magnitude.\n */\nCartesian4.magnitude = function (cartesian) {\n return Math.sqrt(Cartesian4.magnitudeSquared(cartesian));\n};\n\nconst distanceScratch = new Cartesian4();\n\n/**\n * Computes the 4-space distance between two points.\n *\n * @param {Cartesian4} left The first point to compute the distance from.\n * @param {Cartesian4} right The second point to compute the distance to.\n * @returns {number} The distance between two points.\n *\n * @example\n * // Returns 1.0\n * const d = Cesium.Cartesian4.distance(\n * new Cesium.Cartesian4(1.0, 0.0, 0.0, 0.0),\n * new Cesium.Cartesian4(2.0, 0.0, 0.0, 0.0));\n */\nCartesian4.distance = function (left, right) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"left\", left);\n Check.typeOf.object(\"right\", right);\n //>>includeEnd('debug');\n\n Cartesian4.subtract(left, right, distanceScratch);\n return Cartesian4.magnitude(distanceScratch);\n};\n\n/**\n * Computes the squared distance between two points. Comparing squared distances\n * using this function is more efficient than comparing distances using {@link Cartesian4#distance}.\n *\n * @param {Cartesian4} left The first point to compute the distance from.\n * @param {Cartesian4} right The second point to compute the distance to.\n * @returns {number} The distance between two points.\n *\n * @example\n * // Returns 4.0, not 2.0\n * const d = Cesium.Cartesian4.distance(\n * new Cesium.Cartesian4(1.0, 0.0, 0.0, 0.0),\n * new Cesium.Cartesian4(3.0, 0.0, 0.0, 0.0));\n */\nCartesian4.distanceSquared = function (left, right) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"left\", left);\n Check.typeOf.object(\"right\", right);\n //>>includeEnd('debug');\n\n Cartesian4.subtract(left, right, distanceScratch);\n return Cartesian4.magnitudeSquared(distanceScratch);\n};\n\n/**\n * Computes the normalized form of the supplied Cartesian.\n *\n * @param {Cartesian4} cartesian The Cartesian to be normalized.\n * @param {Cartesian4} result The object onto which to store the result.\n * @returns {Cartesian4} The modified result parameter.\n */\nCartesian4.normalize = function (cartesian, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"cartesian\", cartesian);\n Check.typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n\n const magnitude = Cartesian4.magnitude(cartesian);\n\n result.x = cartesian.x / magnitude;\n result.y = cartesian.y / magnitude;\n result.z = cartesian.z / magnitude;\n result.w = cartesian.w / magnitude;\n\n //>>includeStart('debug', pragmas.debug);\n if (\n isNaN(result.x) ||\n isNaN(result.y) ||\n isNaN(result.z) ||\n isNaN(result.w)\n ) {\n throw new DeveloperError(\"normalized result is not a number\");\n }\n //>>includeEnd('debug');\n\n return result;\n};\n\n/**\n * Computes the dot (scalar) product of two Cartesians.\n *\n * @param {Cartesian4} left The first Cartesian.\n * @param {Cartesian4} right The second Cartesian.\n * @returns {number} The dot product.\n */\nCartesian4.dot = function (left, right) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"left\", left);\n Check.typeOf.object(\"right\", right);\n //>>includeEnd('debug');\n\n return (\n left.x * right.x + left.y * right.y + left.z * right.z + left.w * right.w\n );\n};\n\n/**\n * Computes the componentwise product of two Cartesians.\n *\n * @param {Cartesian4} left The first Cartesian.\n * @param {Cartesian4} right The second Cartesian.\n * @param {Cartesian4} result The object onto which to store the result.\n * @returns {Cartesian4} The modified result parameter.\n */\nCartesian4.multiplyComponents = function (left, right, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"left\", left);\n Check.typeOf.object(\"right\", right);\n Check.typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n\n result.x = left.x * right.x;\n result.y = left.y * right.y;\n result.z = left.z * right.z;\n result.w = left.w * right.w;\n return result;\n};\n\n/**\n * Computes the componentwise quotient of two Cartesians.\n *\n * @param {Cartesian4} left The first Cartesian.\n * @param {Cartesian4} right The second Cartesian.\n * @param {Cartesian4} result The object onto which to store the result.\n * @returns {Cartesian4} The modified result parameter.\n */\nCartesian4.divideComponents = function (left, right, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"left\", left);\n Check.typeOf.object(\"right\", right);\n Check.typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n\n result.x = left.x / right.x;\n result.y = left.y / right.y;\n result.z = left.z / right.z;\n result.w = left.w / right.w;\n return result;\n};\n\n/**\n * Computes the componentwise sum of two Cartesians.\n *\n * @param {Cartesian4} left The first Cartesian.\n * @param {Cartesian4} right The second Cartesian.\n * @param {Cartesian4} result The object onto which to store the result.\n * @returns {Cartesian4} The modified result parameter.\n */\nCartesian4.add = function (left, right, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"left\", left);\n Check.typeOf.object(\"right\", right);\n Check.typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n\n result.x = left.x + right.x;\n result.y = left.y + right.y;\n result.z = left.z + right.z;\n result.w = left.w + right.w;\n return result;\n};\n\n/**\n * Computes the componentwise difference of two Cartesians.\n *\n * @param {Cartesian4} left The first Cartesian.\n * @param {Cartesian4} right The second Cartesian.\n * @param {Cartesian4} result The object onto which to store the result.\n * @returns {Cartesian4} The modified result parameter.\n */\nCartesian4.subtract = function (left, right, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"left\", left);\n Check.typeOf.object(\"right\", right);\n Check.typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n\n result.x = left.x - right.x;\n result.y = left.y - right.y;\n result.z = left.z - right.z;\n result.w = left.w - right.w;\n return result;\n};\n\n/**\n * Multiplies the provided Cartesian componentwise by the provided scalar.\n *\n * @param {Cartesian4} cartesian The Cartesian to be scaled.\n * @param {number} scalar The scalar to multiply with.\n * @param {Cartesian4} result The object onto which to store the result.\n * @returns {Cartesian4} The modified result parameter.\n */\nCartesian4.multiplyByScalar = function (cartesian, scalar, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"cartesian\", cartesian);\n Check.typeOf.number(\"scalar\", scalar);\n Check.typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n\n result.x = cartesian.x * scalar;\n result.y = cartesian.y * scalar;\n result.z = cartesian.z * scalar;\n result.w = cartesian.w * scalar;\n return result;\n};\n\n/**\n * Divides the provided Cartesian componentwise by the provided scalar.\n *\n * @param {Cartesian4} cartesian The Cartesian to be divided.\n * @param {number} scalar The scalar to divide by.\n * @param {Cartesian4} result The object onto which to store the result.\n * @returns {Cartesian4} The modified result parameter.\n */\nCartesian4.divideByScalar = function (cartesian, scalar, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"cartesian\", cartesian);\n Check.typeOf.number(\"scalar\", scalar);\n Check.typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n\n result.x = cartesian.x / scalar;\n result.y = cartesian.y / scalar;\n result.z = cartesian.z / scalar;\n result.w = cartesian.w / scalar;\n return result;\n};\n\n/**\n * Negates the provided Cartesian.\n *\n * @param {Cartesian4} cartesian The Cartesian to be negated.\n * @param {Cartesian4} result The object onto which to store the result.\n * @returns {Cartesian4} The modified result parameter.\n */\nCartesian4.negate = function (cartesian, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"cartesian\", cartesian);\n Check.typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n\n result.x = -cartesian.x;\n result.y = -cartesian.y;\n result.z = -cartesian.z;\n result.w = -cartesian.w;\n return result;\n};\n\n/**\n * Computes the absolute value of the provided Cartesian.\n *\n * @param {Cartesian4} cartesian The Cartesian whose absolute value is to be computed.\n * @param {Cartesian4} result The object onto which to store the result.\n * @returns {Cartesian4} The modified result parameter.\n */\nCartesian4.abs = function (cartesian, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"cartesian\", cartesian);\n Check.typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n\n result.x = Math.abs(cartesian.x);\n result.y = Math.abs(cartesian.y);\n result.z = Math.abs(cartesian.z);\n result.w = Math.abs(cartesian.w);\n return result;\n};\n\nconst lerpScratch = new Cartesian4();\n/**\n * Computes the linear interpolation or extrapolation at t using the provided cartesians.\n *\n * @param {Cartesian4} start The value corresponding to t at 0.0.\n * @param {Cartesian4}end The value corresponding to t at 1.0.\n * @param {number} t The point along t at which to interpolate.\n * @param {Cartesian4} result The object onto which to store the result.\n * @returns {Cartesian4} The modified result parameter.\n */\nCartesian4.lerp = function (start, end, t, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"start\", start);\n Check.typeOf.object(\"end\", end);\n Check.typeOf.number(\"t\", t);\n Check.typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n\n Cartesian4.multiplyByScalar(end, t, lerpScratch);\n result = Cartesian4.multiplyByScalar(start, 1.0 - t, result);\n return Cartesian4.add(lerpScratch, result, result);\n};\n\nconst mostOrthogonalAxisScratch = new Cartesian4();\n/**\n * Returns the axis that is most orthogonal to the provided Cartesian.\n *\n * @param {Cartesian4} cartesian The Cartesian on which to find the most orthogonal axis.\n * @param {Cartesian4} result The object onto which to store the result.\n * @returns {Cartesian4} The most orthogonal axis.\n */\nCartesian4.mostOrthogonalAxis = function (cartesian, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"cartesian\", cartesian);\n Check.typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n\n const f = Cartesian4.normalize(cartesian, mostOrthogonalAxisScratch);\n Cartesian4.abs(f, f);\n\n if (f.x <= f.y) {\n if (f.x <= f.z) {\n if (f.x <= f.w) {\n result = Cartesian4.clone(Cartesian4.UNIT_X, result);\n } else {\n result = Cartesian4.clone(Cartesian4.UNIT_W, result);\n }\n } else if (f.z <= f.w) {\n result = Cartesian4.clone(Cartesian4.UNIT_Z, result);\n } else {\n result = Cartesian4.clone(Cartesian4.UNIT_W, result);\n }\n } else if (f.y <= f.z) {\n if (f.y <= f.w) {\n result = Cartesian4.clone(Cartesian4.UNIT_Y, result);\n } else {\n result = Cartesian4.clone(Cartesian4.UNIT_W, result);\n }\n } else if (f.z <= f.w) {\n result = Cartesian4.clone(Cartesian4.UNIT_Z, result);\n } else {\n result = Cartesian4.clone(Cartesian4.UNIT_W, result);\n }\n\n return result;\n};\n\n/**\n * Compares the provided Cartesians componentwise and returns\n * true
if they are equal, false
otherwise.\n *\n * @param {Cartesian4} [left] The first Cartesian.\n * @param {Cartesian4} [right] The second Cartesian.\n * @returns {boolean} true
if left and right are equal, false
otherwise.\n */\nCartesian4.equals = function (left, right) {\n return (\n left === right ||\n (defined(left) &&\n defined(right) &&\n left.x === right.x &&\n left.y === right.y &&\n left.z === right.z &&\n left.w === right.w)\n );\n};\n\n/**\n * @private\n */\nCartesian4.equalsArray = function (cartesian, array, offset) {\n return (\n cartesian.x === array[offset] &&\n cartesian.y === array[offset + 1] &&\n cartesian.z === array[offset + 2] &&\n cartesian.w === array[offset + 3]\n );\n};\n\n/**\n * Compares the provided Cartesians componentwise and returns\n * true
if they pass an absolute or relative tolerance test,\n * false
otherwise.\n *\n * @param {Cartesian4} [left] The first Cartesian.\n * @param {Cartesian4} [right] The second Cartesian.\n * @param {number} [relativeEpsilon=0] The relative epsilon tolerance to use for equality testing.\n * @param {number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing.\n * @returns {boolean} true
if left and right are within the provided epsilon, false
otherwise.\n */\nCartesian4.equalsEpsilon = function (\n left,\n right,\n relativeEpsilon,\n absoluteEpsilon,\n) {\n return (\n left === right ||\n (defined(left) &&\n defined(right) &&\n CesiumMath.equalsEpsilon(\n left.x,\n right.x,\n relativeEpsilon,\n absoluteEpsilon,\n ) &&\n CesiumMath.equalsEpsilon(\n left.y,\n right.y,\n relativeEpsilon,\n absoluteEpsilon,\n ) &&\n CesiumMath.equalsEpsilon(\n left.z,\n right.z,\n relativeEpsilon,\n absoluteEpsilon,\n ) &&\n CesiumMath.equalsEpsilon(\n left.w,\n right.w,\n relativeEpsilon,\n absoluteEpsilon,\n ))\n );\n};\n\n/**\n * An immutable Cartesian4 instance initialized to (0.0, 0.0, 0.0, 0.0).\n *\n * @type {Cartesian4}\n * @constant\n */\nCartesian4.ZERO = Object.freeze(new Cartesian4(0.0, 0.0, 0.0, 0.0));\n\n/**\n * An immutable Cartesian4 instance initialized to (1.0, 1.0, 1.0, 1.0).\n *\n * @type {Cartesian4}\n * @constant\n */\nCartesian4.ONE = Object.freeze(new Cartesian4(1.0, 1.0, 1.0, 1.0));\n\n/**\n * An immutable Cartesian4 instance initialized to (1.0, 0.0, 0.0, 0.0).\n *\n * @type {Cartesian4}\n * @constant\n */\nCartesian4.UNIT_X = Object.freeze(new Cartesian4(1.0, 0.0, 0.0, 0.0));\n\n/**\n * An immutable Cartesian4 instance initialized to (0.0, 1.0, 0.0, 0.0).\n *\n * @type {Cartesian4}\n * @constant\n */\nCartesian4.UNIT_Y = Object.freeze(new Cartesian4(0.0, 1.0, 0.0, 0.0));\n\n/**\n * An immutable Cartesian4 instance initialized to (0.0, 0.0, 1.0, 0.0).\n *\n * @type {Cartesian4}\n * @constant\n */\nCartesian4.UNIT_Z = Object.freeze(new Cartesian4(0.0, 0.0, 1.0, 0.0));\n\n/**\n * An immutable Cartesian4 instance initialized to (0.0, 0.0, 0.0, 1.0).\n *\n * @type {Cartesian4}\n * @constant\n */\nCartesian4.UNIT_W = Object.freeze(new Cartesian4(0.0, 0.0, 0.0, 1.0));\n\n/**\n * Duplicates this Cartesian4 instance.\n *\n * @param {Cartesian4} [result] The object onto which to store the result.\n * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided.\n */\nCartesian4.prototype.clone = function (result) {\n return Cartesian4.clone(this, result);\n};\n\n/**\n * Compares this Cartesian against the provided Cartesian componentwise and returns\n * true
if they are equal, false
otherwise.\n *\n * @param {Cartesian4} [right] The right hand side Cartesian.\n * @returns {boolean} true
if they are equal, false
otherwise.\n */\nCartesian4.prototype.equals = function (right) {\n return Cartesian4.equals(this, right);\n};\n\n/**\n * Compares this Cartesian against the provided Cartesian componentwise and returns\n * true
if they pass an absolute or relative tolerance test,\n * false
otherwise.\n *\n * @param {Cartesian4} [right] The right hand side Cartesian.\n * @param {number} [relativeEpsilon=0] The relative epsilon tolerance to use for equality testing.\n * @param {number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing.\n * @returns {boolean} true
if they are within the provided epsilon, false
otherwise.\n */\nCartesian4.prototype.equalsEpsilon = function (\n right,\n relativeEpsilon,\n absoluteEpsilon,\n) {\n return Cartesian4.equalsEpsilon(\n this,\n right,\n relativeEpsilon,\n absoluteEpsilon,\n );\n};\n\n/**\n * Creates a string representing this Cartesian in the format '(x, y, z, w)'.\n *\n * @returns {string} A string representing the provided Cartesian in the format '(x, y, z, w)'.\n */\nCartesian4.prototype.toString = function () {\n return `(${this.x}, ${this.y}, ${this.z}, ${this.w})`;\n};\n\n// scratchU8Array and scratchF32Array are views into the same buffer\nconst scratchF32Array = new Float32Array(1);\nconst scratchU8Array = new Uint8Array(scratchF32Array.buffer);\n\nconst testU32 = new Uint32Array([0x11223344]);\nconst testU8 = new Uint8Array(testU32.buffer);\nconst littleEndian = testU8[0] === 0x44;\n\n/**\n * Packs an arbitrary floating point value to 4 values representable using uint8.\n *\n * @param {number} value A floating point number.\n * @param {Cartesian4} [result] The Cartesian4 that will contain the packed float.\n * @returns {Cartesian4} A Cartesian4 representing the float packed to values in x, y, z, and w.\n */\nCartesian4.packFloat = function (value, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.number(\"value\", value);\n //>>includeEnd('debug');\n\n if (!defined(result)) {\n result = new Cartesian4();\n }\n\n // scratchU8Array and scratchF32Array are views into the same buffer\n scratchF32Array[0] = value;\n\n if (littleEndian) {\n result.x = scratchU8Array[0];\n result.y = scratchU8Array[1];\n result.z = scratchU8Array[2];\n result.w = scratchU8Array[3];\n } else {\n // convert from big-endian to little-endian\n result.x = scratchU8Array[3];\n result.y = scratchU8Array[2];\n result.z = scratchU8Array[1];\n result.w = scratchU8Array[0];\n }\n return result;\n};\n\n/**\n * Unpacks a float packed using Cartesian4.packFloat.\n *\n * @param {Cartesian4} packedFloat A Cartesian4 containing a float packed to 4 values representable using uint8.\n * @returns {number} The unpacked float.\n * @private\n */\nCartesian4.unpackFloat = function (packedFloat) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"packedFloat\", packedFloat);\n //>>includeEnd('debug');\n\n // scratchU8Array and scratchF32Array are views into the same buffer\n if (littleEndian) {\n scratchU8Array[0] = packedFloat.x;\n scratchU8Array[1] = packedFloat.y;\n scratchU8Array[2] = packedFloat.z;\n scratchU8Array[3] = packedFloat.w;\n } else {\n // convert from little-endian to big-endian\n scratchU8Array[0] = packedFloat.w;\n scratchU8Array[1] = packedFloat.z;\n scratchU8Array[2] = packedFloat.y;\n scratchU8Array[3] = packedFloat.x;\n }\n return scratchF32Array[0];\n};\nexport default Cartesian4;\n","import Cartesian3 from \"./Cartesian3.js\";\nimport Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport CesiumMath from \"./Math.js\";\n\n/**\n * A 3x3 matrix, indexable as a column-major order array.\n * Constructor parameters are in row-major order for code readability.\n * @alias Matrix3\n * @constructor\n * @implements {ArrayLike\n * Returns a diagonal matrix and unitary matrix such that:\n * matrix = unitary matrix * diagonal matrix * transpose(unitary matrix)
\n *
\n * The values along the diagonal of the diagonal matrix are the eigenvalues. The columns\n * of the unitary matrix are the corresponding eigenvectors.\n *
\n *\n * @param {Matrix3} matrix The matrix to decompose into diagonal and unitary matrix. Expected to be symmetric.\n * @param {object} [result] An object with unitary and diagonal properties which are matrices onto which to store the result.\n * @returns {object} An object with unitary and diagonal properties which are the unitary and diagonal matrices, respectively.\n *\n * @example\n * const a = //... symetric matrix\n * const result = {\n * unitary : new Cesium.Matrix3(),\n * diagonal : new Cesium.Matrix3()\n * };\n * Cesium.Matrix3.computeEigenDecomposition(a, result);\n *\n * const unitaryTranspose = Cesium.Matrix3.transpose(result.unitary, new Cesium.Matrix3());\n * const b = Cesium.Matrix3.multiply(result.unitary, result.diagonal, new Cesium.Matrix3());\n * Cesium.Matrix3.multiply(b, unitaryTranspose, b); // b is now equal to a\n *\n * const lambda = Cesium.Matrix3.getColumn(result.diagonal, 0, new Cesium.Cartesian3()).x; // first eigenvalue\n * const v = Cesium.Matrix3.getColumn(result.unitary, 0, new Cesium.Cartesian3()); // first eigenvector\n * const c = Cesium.Cartesian3.multiplyByScalar(v, lambda, new Cesium.Cartesian3()); // equal to Cesium.Matrix3.multiplyByVector(a, v)\n */\nMatrix3.computeEigenDecomposition = function (matrix, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"matrix\", matrix);\n //>>includeEnd('debug');\n\n // This routine was created based upon Matrix Computations, 3rd ed., by Golub and Van Loan,\n // section 8.4.3 The Classical Jacobi Algorithm\n\n const tolerance = CesiumMath.EPSILON20;\n const maxSweeps = 10;\n\n let count = 0;\n let sweep = 0;\n\n if (!defined(result)) {\n result = {};\n }\n\n const unitaryMatrix = (result.unitary = Matrix3.clone(\n Matrix3.IDENTITY,\n result.unitary,\n ));\n const diagMatrix = (result.diagonal = Matrix3.clone(matrix, result.diagonal));\n\n const epsilon = tolerance * computeFrobeniusNorm(diagMatrix);\n\n while (sweep < maxSweeps && offDiagonalFrobeniusNorm(diagMatrix) > epsilon) {\n shurDecomposition(diagMatrix, jMatrix);\n Matrix3.transpose(jMatrix, jMatrixTranspose);\n Matrix3.multiply(diagMatrix, jMatrix, diagMatrix);\n Matrix3.multiply(jMatrixTranspose, diagMatrix, diagMatrix);\n Matrix3.multiply(unitaryMatrix, jMatrix, unitaryMatrix);\n\n if (++count > 2) {\n ++sweep;\n count = 0;\n }\n }\n\n return result;\n};\n\n/**\n * Computes a matrix, which contains the absolute (unsigned) values of the provided matrix's elements.\n *\n * @param {Matrix3} matrix The matrix with signed elements.\n * @param {Matrix3} result The object onto which to store the result.\n * @returns {Matrix3} The modified result parameter.\n */\nMatrix3.abs = function (matrix, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"matrix\", matrix);\n Check.typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n\n result[0] = Math.abs(matrix[0]);\n result[1] = Math.abs(matrix[1]);\n result[2] = Math.abs(matrix[2]);\n result[3] = Math.abs(matrix[3]);\n result[4] = Math.abs(matrix[4]);\n result[5] = Math.abs(matrix[5]);\n result[6] = Math.abs(matrix[6]);\n result[7] = Math.abs(matrix[7]);\n result[8] = Math.abs(matrix[8]);\n\n return result;\n};\n\n/**\n * Computes the determinant of the provided matrix.\n *\n * @param {Matrix3} matrix The matrix to use.\n * @returns {number} The value of the determinant of the matrix.\n */\nMatrix3.determinant = function (matrix) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"matrix\", matrix);\n //>>includeEnd('debug');\n\n const m11 = matrix[0];\n const m21 = matrix[3];\n const m31 = matrix[6];\n const m12 = matrix[1];\n const m22 = matrix[4];\n const m32 = matrix[7];\n const m13 = matrix[2];\n const m23 = matrix[5];\n const m33 = matrix[8];\n\n return (\n m11 * (m22 * m33 - m23 * m32) +\n m12 * (m23 * m31 - m21 * m33) +\n m13 * (m21 * m32 - m22 * m31)\n );\n};\n\n/**\n * Computes the inverse of the provided matrix.\n *\n * @param {Matrix3} matrix The matrix to invert.\n * @param {Matrix3} result The object onto which to store the result.\n * @returns {Matrix3} The modified result parameter.\n *\n * @exception {DeveloperError} matrix is not invertible.\n */\nMatrix3.inverse = function (matrix, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"matrix\", matrix);\n Check.typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n\n const m11 = matrix[0];\n const m21 = matrix[1];\n const m31 = matrix[2];\n const m12 = matrix[3];\n const m22 = matrix[4];\n const m32 = matrix[5];\n const m13 = matrix[6];\n const m23 = matrix[7];\n const m33 = matrix[8];\n\n const determinant = Matrix3.determinant(matrix);\n\n //>>includeStart('debug', pragmas.debug);\n if (Math.abs(determinant) <= CesiumMath.EPSILON15) {\n throw new DeveloperError(\"matrix is not invertible\");\n }\n //>>includeEnd('debug');\n\n result[0] = m22 * m33 - m23 * m32;\n result[1] = m23 * m31 - m21 * m33;\n result[2] = m21 * m32 - m22 * m31;\n result[3] = m13 * m32 - m12 * m33;\n result[4] = m11 * m33 - m13 * m31;\n result[5] = m12 * m31 - m11 * m32;\n result[6] = m12 * m23 - m13 * m22;\n result[7] = m13 * m21 - m11 * m23;\n result[8] = m11 * m22 - m12 * m21;\n\n const scale = 1.0 / determinant;\n return Matrix3.multiplyByScalar(result, scale, result);\n};\n\nconst scratchTransposeMatrix = new Matrix3();\n\n/**\n * Computes the inverse transpose of a matrix.\n *\n * @param {Matrix3} matrix The matrix to transpose and invert.\n * @param {Matrix3} result The object onto which to store the result.\n * @returns {Matrix3} The modified result parameter.\n */\nMatrix3.inverseTranspose = function (matrix, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"matrix\", matrix);\n Check.typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n\n return Matrix3.inverse(\n Matrix3.transpose(matrix, scratchTransposeMatrix),\n result,\n );\n};\n\n/**\n * Compares the provided matrices componentwise and returns\n *true
if they are equal, false
otherwise.\n *\n * @param {Matrix3} [left] The first matrix.\n * @param {Matrix3} [right] The second matrix.\n * @returns {boolean} true
if left and right are equal, false
otherwise.\n */\nMatrix3.equals = function (left, right) {\n return (\n left === right ||\n (defined(left) &&\n defined(right) &&\n left[0] === right[0] &&\n left[1] === right[1] &&\n left[2] === right[2] &&\n left[3] === right[3] &&\n left[4] === right[4] &&\n left[5] === right[5] &&\n left[6] === right[6] &&\n left[7] === right[7] &&\n left[8] === right[8])\n );\n};\n\n/**\n * Compares the provided matrices componentwise and returns\n * true
if they are within the provided epsilon,\n * false
otherwise.\n *\n * @param {Matrix3} [left] The first matrix.\n * @param {Matrix3} [right] The second matrix.\n * @param {number} [epsilon=0] The epsilon to use for equality testing.\n * @returns {boolean} true
if left and right are within the provided epsilon, false
otherwise.\n */\nMatrix3.equalsEpsilon = function (left, right, epsilon) {\n epsilon = defaultValue(epsilon, 0);\n\n return (\n left === right ||\n (defined(left) &&\n defined(right) &&\n Math.abs(left[0] - right[0]) <= epsilon &&\n Math.abs(left[1] - right[1]) <= epsilon &&\n Math.abs(left[2] - right[2]) <= epsilon &&\n Math.abs(left[3] - right[3]) <= epsilon &&\n Math.abs(left[4] - right[4]) <= epsilon &&\n Math.abs(left[5] - right[5]) <= epsilon &&\n Math.abs(left[6] - right[6]) <= epsilon &&\n Math.abs(left[7] - right[7]) <= epsilon &&\n Math.abs(left[8] - right[8]) <= epsilon)\n );\n};\n\n/**\n * An immutable Matrix3 instance initialized to the identity matrix.\n *\n * @type {Matrix3}\n * @constant\n */\nMatrix3.IDENTITY = Object.freeze(\n new Matrix3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0),\n);\n\n/**\n * An immutable Matrix3 instance initialized to the zero matrix.\n *\n * @type {Matrix3}\n * @constant\n */\nMatrix3.ZERO = Object.freeze(\n new Matrix3(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0),\n);\n\n/**\n * The index into Matrix3 for column 0, row 0.\n *\n * @type {number}\n * @constant\n */\nMatrix3.COLUMN0ROW0 = 0;\n\n/**\n * The index into Matrix3 for column 0, row 1.\n *\n * @type {number}\n * @constant\n */\nMatrix3.COLUMN0ROW1 = 1;\n\n/**\n * The index into Matrix3 for column 0, row 2.\n *\n * @type {number}\n * @constant\n */\nMatrix3.COLUMN0ROW2 = 2;\n\n/**\n * The index into Matrix3 for column 1, row 0.\n *\n * @type {number}\n * @constant\n */\nMatrix3.COLUMN1ROW0 = 3;\n\n/**\n * The index into Matrix3 for column 1, row 1.\n *\n * @type {number}\n * @constant\n */\nMatrix3.COLUMN1ROW1 = 4;\n\n/**\n * The index into Matrix3 for column 1, row 2.\n *\n * @type {number}\n * @constant\n */\nMatrix3.COLUMN1ROW2 = 5;\n\n/**\n * The index into Matrix3 for column 2, row 0.\n *\n * @type {number}\n * @constant\n */\nMatrix3.COLUMN2ROW0 = 6;\n\n/**\n * The index into Matrix3 for column 2, row 1.\n *\n * @type {number}\n * @constant\n */\nMatrix3.COLUMN2ROW1 = 7;\n\n/**\n * The index into Matrix3 for column 2, row 2.\n *\n * @type {number}\n * @constant\n */\nMatrix3.COLUMN2ROW2 = 8;\n\nObject.defineProperties(Matrix3.prototype, {\n /**\n * Gets the number of items in the collection.\n * @memberof Matrix3.prototype\n *\n * @type {number}\n */\n length: {\n get: function () {\n return Matrix3.packedLength;\n },\n },\n});\n\n/**\n * Duplicates the provided Matrix3 instance.\n *\n * @param {Matrix3} [result] The object onto which to store the result.\n * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if one was not provided.\n */\nMatrix3.prototype.clone = function (result) {\n return Matrix3.clone(this, result);\n};\n\n/**\n * Compares this matrix to the provided matrix componentwise and returns\n * true
if they are equal, false
otherwise.\n *\n * @param {Matrix3} [right] The right hand side matrix.\n * @returns {boolean} true
if they are equal, false
otherwise.\n */\nMatrix3.prototype.equals = function (right) {\n return Matrix3.equals(this, right);\n};\n\n/**\n * @private\n */\nMatrix3.equalsArray = function (matrix, array, offset) {\n return (\n matrix[0] === array[offset] &&\n matrix[1] === array[offset + 1] &&\n matrix[2] === array[offset + 2] &&\n matrix[3] === array[offset + 3] &&\n matrix[4] === array[offset + 4] &&\n matrix[5] === array[offset + 5] &&\n matrix[6] === array[offset + 6] &&\n matrix[7] === array[offset + 7] &&\n matrix[8] === array[offset + 8]\n );\n};\n\n/**\n * Compares this matrix to the provided matrix componentwise and returns\n * true
if they are within the provided epsilon,\n * false
otherwise.\n *\n * @param {Matrix3} [right] The right hand side matrix.\n * @param {number} [epsilon=0] The epsilon to use for equality testing.\n * @returns {boolean} true
if they are within the provided epsilon, false
otherwise.\n */\nMatrix3.prototype.equalsEpsilon = function (right, epsilon) {\n return Matrix3.equalsEpsilon(this, right, epsilon);\n};\n\n/**\n * Creates a string representing this Matrix with each row being\n * on a separate line and in the format '(column0, column1, column2)'.\n *\n * @returns {string} A string representing the provided Matrix with each row being on a separate line and in the format '(column0, column1, column2)'.\n */\nMatrix3.prototype.toString = function () {\n return (\n `(${this[0]}, ${this[3]}, ${this[6]})\\n` +\n `(${this[1]}, ${this[4]}, ${this[7]})\\n` +\n `(${this[2]}, ${this[5]}, ${this[8]})`\n );\n};\nexport default Matrix3;\n","import defined from \"./defined.js\";\n\n/**\n * Constructs an exception object that is thrown due to an error that can occur at runtime, e.g.,\n * out of memory, could not compile shader, etc. If a function may throw this\n * exception, the calling code should be prepared to catch it.\n * x
axis points in the local east direction.y
axis points in the local north direction.z
axis points in the direction of the ellipsoid surface normal which passes through the position.x
axis points in the local north direction.y
axis points in the local east direction.z
axis points in the opposite direction of the ellipsoid surface normal which passes through the position.x
axis points in the local north direction.y
axis points in the direction of the ellipsoid surface normal which passes through the position.z
axis points in the local east direction.x
axis points in the local north direction.y
axis points in the local west direction.z
axis points in the direction of the ellipsoid surface normal which passes through the position.itemToFind
in the array, if it exists. If itemToFind
\n * does not exist, the return value is a negative number which is the bitwise complement (~)\n * of the index before which the itemToFind should be inserted in order to maintain the\n * sorted order of the array.\n *\n * @example\n * // Create a comparator function to search through an array of numbers.\n * function comparator(a, b) {\n * return a - b;\n * };\n * const numbers = [0, 2, 4, 6, 8];\n * const index = Cesium.binarySearch(numbers, 6, comparator); // 3\n */\nfunction binarySearch(array, itemToFind, comparator) {\n //>>includeStart('debug', pragmas.debug);\n Check.defined(\"array\", array);\n Check.defined(\"itemToFind\", itemToFind);\n Check.defined(\"comparator\", comparator);\n //>>includeEnd('debug');\n\n let low = 0;\n let high = array.length - 1;\n let i;\n let comparison;\n\n while (low <= high) {\n i = ~~((low + high) / 2);\n comparison = comparator(array[i], itemToFind);\n if (comparison < 0) {\n low = i + 1;\n continue;\n }\n if (comparison > 0) {\n high = i - 1;\n continue;\n }\n return i;\n }\n return ~(high + 1);\n}\n\n/**\n * A function used to compare two items while performing a binary search.\n * @callback binarySearchComparator\n *\n * @param {*} a An item in the array.\n * @param {*} b The item being searched for.\n * @returns {number} Returns a negative value if a
is less than b
,\n * a positive value if a
is greater than b
, or\n * 0 if a
is equal to b
.\n *\n * @example\n * function compareNumbers(a, b) {\n * return a - b;\n * }\n */\nexport default binarySearch;\n","/**\n * A set of Earth Orientation Parameters (EOP) sampled at a time.\n *\n * @alias EarthOrientationParametersSample\n * @constructor\n *\n * @param {number} xPoleWander The pole wander about the X axis, in radians.\n * @param {number} yPoleWander The pole wander about the Y axis, in radians.\n * @param {number} xPoleOffset The offset to the Celestial Intermediate Pole (CIP) about the X axis, in radians.\n * @param {number} yPoleOffset The offset to the Celestial Intermediate Pole (CIP) about the Y axis, in radians.\n * @param {number} ut1MinusUtc The difference in time standards, UT1 - UTC, in seconds.\n *\n * @private\n */\nfunction EarthOrientationParametersSample(\n xPoleWander,\n yPoleWander,\n xPoleOffset,\n yPoleOffset,\n ut1MinusUtc,\n) {\n /**\n * The pole wander about the X axis, in radians.\n * @type {number}\n */\n this.xPoleWander = xPoleWander;\n\n /**\n * The pole wander about the Y axis, in radians.\n * @type {number}\n */\n this.yPoleWander = yPoleWander;\n\n /**\n * The offset to the Celestial Intermediate Pole (CIP) about the X axis, in radians.\n * @type {number}\n */\n this.xPoleOffset = xPoleOffset;\n\n /**\n * The offset to the Celestial Intermediate Pole (CIP) about the Y axis, in radians.\n * @type {number}\n */\n this.yPoleOffset = yPoleOffset;\n\n /**\n * The difference in time standards, UT1 - UTC, in seconds.\n * @type {number}\n */\n this.ut1MinusUtc = ut1MinusUtc;\n}\nexport default EarthOrientationParametersSample;\n","import binarySearch from \"./binarySearch.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport GregorianDate from \"./GregorianDate.js\";\nimport isLeapYear from \"./isLeapYear.js\";\nimport LeapSecond from \"./LeapSecond.js\";\nimport TimeConstants from \"./TimeConstants.js\";\nimport TimeStandard from \"./TimeStandard.js\";\n\nconst gregorianDateScratch = new GregorianDate();\nconst daysInMonth = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\nconst daysInLeapFeburary = 29;\n\nfunction compareLeapSecondDates(leapSecond, dateToFind) {\n return JulianDate.compare(leapSecond.julianDate, dateToFind.julianDate);\n}\n\n// we don't really need a leap second instance, anything with a julianDate property will do\nconst binarySearchScratchLeapSecond = new LeapSecond();\n\nfunction convertUtcToTai(julianDate) {\n //Even though julianDate is in UTC, we'll treat it as TAI and\n //search the leap second table for it.\n binarySearchScratchLeapSecond.julianDate = julianDate;\n const leapSeconds = JulianDate.leapSeconds;\n let index = binarySearch(\n leapSeconds,\n binarySearchScratchLeapSecond,\n compareLeapSecondDates,\n );\n\n if (index < 0) {\n index = ~index;\n }\n\n if (index >= leapSeconds.length) {\n index = leapSeconds.length - 1;\n }\n\n let offset = leapSeconds[index].offset;\n if (index > 0) {\n //Now we have the index of the closest leap second that comes on or after our UTC time.\n //However, if the difference between the UTC date being converted and the TAI\n //defined leap second is greater than the offset, we are off by one and need to use\n //the previous leap second.\n const difference = JulianDate.secondsDifference(\n leapSeconds[index].julianDate,\n julianDate,\n );\n if (difference > offset) {\n index--;\n offset = leapSeconds[index].offset;\n }\n }\n\n JulianDate.addSeconds(julianDate, offset, julianDate);\n}\n\nfunction convertTaiToUtc(julianDate, result) {\n binarySearchScratchLeapSecond.julianDate = julianDate;\n const leapSeconds = JulianDate.leapSeconds;\n let index = binarySearch(\n leapSeconds,\n binarySearchScratchLeapSecond,\n compareLeapSecondDates,\n );\n if (index < 0) {\n index = ~index;\n }\n\n //All times before our first leap second get the first offset.\n if (index === 0) {\n return JulianDate.addSeconds(julianDate, -leapSeconds[0].offset, result);\n }\n\n //All times after our leap second get the last offset.\n if (index >= leapSeconds.length) {\n return JulianDate.addSeconds(\n julianDate,\n -leapSeconds[index - 1].offset,\n result,\n );\n }\n\n //Compute the difference between the found leap second and the time we are converting.\n const difference = JulianDate.secondsDifference(\n leapSeconds[index].julianDate,\n julianDate,\n );\n\n if (difference === 0) {\n //The date is in our leap second table.\n return JulianDate.addSeconds(\n julianDate,\n -leapSeconds[index].offset,\n result,\n );\n }\n\n if (difference <= 1.0) {\n //The requested date is during the moment of a leap second, then we cannot convert to UTC\n return undefined;\n }\n\n //The time is in between two leap seconds, index is the leap second after the date\n //we're converting, so we subtract one to get the correct LeapSecond instance.\n return JulianDate.addSeconds(\n julianDate,\n -leapSeconds[--index].offset,\n result,\n );\n}\n\nfunction setComponents(wholeDays, secondsOfDay, julianDate) {\n const extraDays = (secondsOfDay / TimeConstants.SECONDS_PER_DAY) | 0;\n wholeDays += extraDays;\n secondsOfDay -= TimeConstants.SECONDS_PER_DAY * extraDays;\n\n if (secondsOfDay < 0) {\n wholeDays--;\n secondsOfDay += TimeConstants.SECONDS_PER_DAY;\n }\n\n julianDate.dayNumber = wholeDays;\n julianDate.secondsOfDay = secondsOfDay;\n return julianDate;\n}\n\nfunction computeJulianDateComponents(\n year,\n month,\n day,\n hour,\n minute,\n second,\n millisecond,\n) {\n // Algorithm from page 604 of the Explanatory Supplement to the\n // Astronomical Almanac (Seidelmann 1992).\n\n const a = ((month - 14) / 12) | 0;\n const b = year + 4800 + a;\n let dayNumber =\n (((1461 * b) / 4) | 0) +\n (((367 * (month - 2 - 12 * a)) / 12) | 0) -\n (((3 * (((b + 100) / 100) | 0)) / 4) | 0) +\n day -\n 32075;\n\n // JulianDates are noon-based\n hour = hour - 12;\n if (hour < 0) {\n hour += 24;\n }\n\n const secondsOfDay =\n second +\n (hour * TimeConstants.SECONDS_PER_HOUR +\n minute * TimeConstants.SECONDS_PER_MINUTE +\n millisecond * TimeConstants.SECONDS_PER_MILLISECOND);\n\n if (secondsOfDay >= 43200.0) {\n dayNumber -= 1;\n }\n\n return [dayNumber, secondsOfDay];\n}\n\n//Regular expressions used for ISO8601 date parsing.\n//YYYY\nconst matchCalendarYear = /^(\\d{4})$/;\n//YYYY-MM (YYYYMM is invalid)\nconst matchCalendarMonth = /^(\\d{4})-(\\d{2})$/;\n//YYYY-DDD or YYYYDDD\nconst matchOrdinalDate = /^(\\d{4})-?(\\d{3})$/;\n//YYYY-Www or YYYYWww or YYYY-Www-D or YYYYWwwD\nconst matchWeekDate = /^(\\d{4})-?W(\\d{2})-?(\\d{1})?$/;\n//YYYY-MM-DD or YYYYMMDD\nconst matchCalendarDate = /^(\\d{4})-?(\\d{2})-?(\\d{2})$/;\n// Match utc offset\nconst utcOffset = /([Z+\\-])?(\\d{2})?:?(\\d{2})?$/;\n// Match hours HH or HH.xxxxx\nconst matchHours = /^(\\d{2})(\\.\\d+)?/.source + utcOffset.source;\n// Match hours/minutes HH:MM HHMM.xxxxx\nconst matchHoursMinutes = /^(\\d{2}):?(\\d{2})(\\.\\d+)?/.source + utcOffset.source;\n// Match hours/minutes HH:MM:SS HHMMSS.xxxxx\nconst matchHoursMinutesSeconds =\n /^(\\d{2}):?(\\d{2}):?(\\d{2})(\\.\\d+)?/.source + utcOffset.source;\n\nconst iso8601ErrorMessage = \"Invalid ISO 8601 date.\";\n\n/**\n * Represents an astronomical Julian date, which is the number of days since noon on January 1, -4712 (4713 BC).\n * For increased precision, this class stores the whole number part of the date and the seconds\n * part of the date in separate components. In order to be safe for arithmetic and represent\n * leap seconds, the date is always stored in the International Atomic Time standard\n * {@link TimeStandard.TAI}.\n * @alias JulianDate\n * @constructor\n *\n * @param {number} [julianDayNumber=0.0] The Julian Day Number representing the number of whole days. Fractional days will also be handled correctly.\n * @param {number} [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.\n * @param {TimeStandard} [timeStandard=TimeStandard.UTC] The time standard in which the first two parameters are defined.\n */\nfunction JulianDate(julianDayNumber, secondsOfDay, timeStandard) {\n /**\n * Gets or sets the number of whole days.\n * @type {number}\n */\n this.dayNumber = undefined;\n\n /**\n * Gets or sets the number of seconds into the current day.\n * @type {number}\n */\n this.secondsOfDay = undefined;\n\n julianDayNumber = defaultValue(julianDayNumber, 0.0);\n secondsOfDay = defaultValue(secondsOfDay, 0.0);\n timeStandard = defaultValue(timeStandard, TimeStandard.UTC);\n\n //If julianDayNumber is fractional, make it an integer and add the number of seconds the fraction represented.\n const wholeDays = julianDayNumber | 0;\n secondsOfDay =\n secondsOfDay +\n (julianDayNumber - wholeDays) * TimeConstants.SECONDS_PER_DAY;\n\n setComponents(wholeDays, secondsOfDay, this);\n\n if (timeStandard === TimeStandard.UTC) {\n convertUtcToTai(this);\n }\n}\n\n/**\n * Creates a new instance from a GregorianDate.\n *\n * @param {GregorianDate} date A GregorianDate.\n * @param {JulianDate} [result] An existing instance to use for the result.\n * @returns {JulianDate} The modified result parameter or a new instance if none was provided.\n *\n * @exception {DeveloperError} date must be a valid GregorianDate.\n */\nJulianDate.fromGregorianDate = function (date, result) {\n //>>includeStart('debug', pragmas.debug);\n if (!(date instanceof GregorianDate)) {\n throw new DeveloperError(\"date must be a valid GregorianDate.\");\n }\n //>>includeEnd('debug');\n\n const components = computeJulianDateComponents(\n date.year,\n date.month,\n date.day,\n date.hour,\n date.minute,\n date.second,\n date.millisecond,\n );\n if (!defined(result)) {\n return new JulianDate(components[0], components[1], TimeStandard.UTC);\n }\n setComponents(components[0], components[1], result);\n convertUtcToTai(result);\n return result;\n};\n\n/**\n * Creates a new instance from a JavaScript Date.\n *\n * @param {Date} date A JavaScript Date.\n * @param {JulianDate} [result] An existing instance to use for the result.\n * @returns {JulianDate} The modified result parameter or a new instance if none was provided.\n *\n * @exception {DeveloperError} date must be a valid JavaScript Date.\n */\nJulianDate.fromDate = function (date, result) {\n //>>includeStart('debug', pragmas.debug);\n if (!(date instanceof Date) || isNaN(date.getTime())) {\n throw new DeveloperError(\"date must be a valid JavaScript Date.\");\n }\n //>>includeEnd('debug');\n\n const components = computeJulianDateComponents(\n date.getUTCFullYear(),\n date.getUTCMonth() + 1,\n date.getUTCDate(),\n date.getUTCHours(),\n date.getUTCMinutes(),\n date.getUTCSeconds(),\n date.getUTCMilliseconds(),\n );\n if (!defined(result)) {\n return new JulianDate(components[0], components[1], TimeStandard.UTC);\n }\n setComponents(components[0], components[1], result);\n convertUtcToTai(result);\n return result;\n};\n\n/**\n * Creates a new instance from a from an {@link http://en.wikipedia.org/wiki/ISO_8601|ISO 8601} date.\n * This method is superior to Date.parse
because it will handle all valid formats defined by the ISO 8601\n * specification, including leap seconds and sub-millisecond times, which discarded by most JavaScript implementations.\n *\n * @param {string} iso8601String An ISO 8601 date.\n * @param {JulianDate} [result] An existing instance to use for the result.\n * @returns {JulianDate} The modified result parameter or a new instance if none was provided.\n *\n * @exception {DeveloperError} Invalid ISO 8601 date.\n */\nJulianDate.fromIso8601 = function (iso8601String, result) {\n //>>includeStart('debug', pragmas.debug);\n if (typeof iso8601String !== \"string\") {\n throw new DeveloperError(iso8601ErrorMessage);\n }\n //>>includeEnd('debug');\n\n //Comma and decimal point both indicate a fractional number according to ISO 8601,\n //start out by blanket replacing , with . which is the only valid such symbol in JS.\n iso8601String = iso8601String.replace(\",\", \".\");\n\n //Split the string into its date and time components, denoted by a mandatory T\n let tokens = iso8601String.split(\"T\");\n let year;\n let month = 1;\n let day = 1;\n let hour = 0;\n let minute = 0;\n let second = 0;\n let millisecond = 0;\n\n //Lacking a time is okay, but a missing date is illegal.\n const date = tokens[0];\n const time = tokens[1];\n let tmp;\n let inLeapYear;\n //>>includeStart('debug', pragmas.debug);\n if (!defined(date)) {\n throw new DeveloperError(iso8601ErrorMessage);\n }\n\n let dashCount;\n //>>includeEnd('debug');\n\n //First match the date against possible regular expressions.\n tokens = date.match(matchCalendarDate);\n if (tokens !== null) {\n //>>includeStart('debug', pragmas.debug);\n dashCount = date.split(\"-\").length - 1;\n if (dashCount > 0 && dashCount !== 2) {\n throw new DeveloperError(iso8601ErrorMessage);\n }\n //>>includeEnd('debug');\n year = +tokens[1];\n month = +tokens[2];\n day = +tokens[3];\n } else {\n tokens = date.match(matchCalendarMonth);\n if (tokens !== null) {\n year = +tokens[1];\n month = +tokens[2];\n } else {\n tokens = date.match(matchCalendarYear);\n if (tokens !== null) {\n year = +tokens[1];\n } else {\n //Not a year/month/day so it must be an ordinal date.\n let dayOfYear;\n tokens = date.match(matchOrdinalDate);\n if (tokens !== null) {\n year = +tokens[1];\n dayOfYear = +tokens[2];\n inLeapYear = isLeapYear(year);\n\n //This validation is only applicable for this format.\n //>>includeStart('debug', pragmas.debug);\n if (\n dayOfYear < 1 ||\n (inLeapYear && dayOfYear > 366) ||\n (!inLeapYear && dayOfYear > 365)\n ) {\n throw new DeveloperError(iso8601ErrorMessage);\n }\n //>>includeEnd('debug')\n } else {\n tokens = date.match(matchWeekDate);\n if (tokens !== null) {\n //ISO week date to ordinal date from\n //http://en.wikipedia.org/w/index.php?title=ISO_week_date&oldid=474176775\n year = +tokens[1];\n const weekNumber = +tokens[2];\n const dayOfWeek = +tokens[3] || 0;\n\n //>>includeStart('debug', pragmas.debug);\n dashCount = date.split(\"-\").length - 1;\n if (\n dashCount > 0 &&\n ((!defined(tokens[3]) && dashCount !== 1) ||\n (defined(tokens[3]) && dashCount !== 2))\n ) {\n throw new DeveloperError(iso8601ErrorMessage);\n }\n //>>includeEnd('debug')\n\n const january4 = new Date(Date.UTC(year, 0, 4));\n dayOfYear = weekNumber * 7 + dayOfWeek - january4.getUTCDay() - 3;\n } else {\n //None of our regular expressions succeeded in parsing the date properly.\n //>>includeStart('debug', pragmas.debug);\n throw new DeveloperError(iso8601ErrorMessage);\n //>>includeEnd('debug')\n }\n }\n //Split an ordinal date into month/day.\n tmp = new Date(Date.UTC(year, 0, 1));\n tmp.setUTCDate(dayOfYear);\n month = tmp.getUTCMonth() + 1;\n day = tmp.getUTCDate();\n }\n }\n }\n\n //Now that we have all of the date components, validate them to make sure nothing is out of range.\n inLeapYear = isLeapYear(year);\n //>>includeStart('debug', pragmas.debug);\n if (\n month < 1 ||\n month > 12 ||\n day < 1 ||\n ((month !== 2 || !inLeapYear) && day > daysInMonth[month - 1]) ||\n (inLeapYear && month === 2 && day > daysInLeapFeburary)\n ) {\n throw new DeveloperError(iso8601ErrorMessage);\n }\n //>>includeEnd('debug')\n\n //Now move onto the time string, which is much simpler.\n //If no time is specified, it is considered the beginning of the day, UTC to match Javascript's implementation.\n let offsetIndex;\n if (defined(time)) {\n tokens = time.match(matchHoursMinutesSeconds);\n if (tokens !== null) {\n //>>includeStart('debug', pragmas.debug);\n dashCount = time.split(\":\").length - 1;\n if (dashCount > 0 && dashCount !== 2 && dashCount !== 3) {\n throw new DeveloperError(iso8601ErrorMessage);\n }\n //>>includeEnd('debug')\n\n hour = +tokens[1];\n minute = +tokens[2];\n second = +tokens[3];\n millisecond = +(tokens[4] || 0) * 1000.0;\n offsetIndex = 5;\n } else {\n tokens = time.match(matchHoursMinutes);\n if (tokens !== null) {\n //>>includeStart('debug', pragmas.debug);\n dashCount = time.split(\":\").length - 1;\n if (dashCount > 2) {\n throw new DeveloperError(iso8601ErrorMessage);\n }\n //>>includeEnd('debug')\n\n hour = +tokens[1];\n minute = +tokens[2];\n second = +(tokens[3] || 0) * 60.0;\n offsetIndex = 4;\n } else {\n tokens = time.match(matchHours);\n if (tokens !== null) {\n hour = +tokens[1];\n minute = +(tokens[2] || 0) * 60.0;\n offsetIndex = 3;\n } else {\n //>>includeStart('debug', pragmas.debug);\n throw new DeveloperError(iso8601ErrorMessage);\n //>>includeEnd('debug')\n }\n }\n }\n\n //Validate that all values are in proper range. Minutes and hours have special cases at 60 and 24.\n //>>includeStart('debug', pragmas.debug);\n if (\n minute >= 60 ||\n second >= 61 ||\n hour > 24 ||\n (hour === 24 && (minute > 0 || second > 0 || millisecond > 0))\n ) {\n throw new DeveloperError(iso8601ErrorMessage);\n }\n //>>includeEnd('debug');\n\n //Check the UTC offset value, if no value exists, use local time\n //a Z indicates UTC, + or - are offsets.\n const offset = tokens[offsetIndex];\n const offsetHours = +tokens[offsetIndex + 1];\n const offsetMinutes = +(tokens[offsetIndex + 2] || 0);\n switch (offset) {\n case \"+\":\n hour = hour - offsetHours;\n minute = minute - offsetMinutes;\n break;\n case \"-\":\n hour = hour + offsetHours;\n minute = minute + offsetMinutes;\n break;\n case \"Z\":\n break;\n default:\n minute =\n minute +\n new Date(\n Date.UTC(year, month - 1, day, hour, minute),\n ).getTimezoneOffset();\n break;\n }\n }\n\n //ISO8601 denotes a leap second by any time having a seconds component of 60 seconds.\n //If that's the case, we need to temporarily subtract a second in order to build a UTC date.\n //Then we add it back in after converting to TAI.\n const isLeapSecond = second === 60;\n if (isLeapSecond) {\n second--;\n }\n\n //Even if we successfully parsed the string into its components, after applying UTC offset or\n //special cases like 24:00:00 denoting midnight, we need to normalize the data appropriately.\n\n //milliseconds can never be greater than 1000, and seconds can't be above 60, so we start with minutes\n while (minute >= 60) {\n minute -= 60;\n hour++;\n }\n\n while (hour >= 24) {\n hour -= 24;\n day++;\n }\n\n tmp = inLeapYear && month === 2 ? daysInLeapFeburary : daysInMonth[month - 1];\n while (day > tmp) {\n day -= tmp;\n month++;\n\n if (month > 12) {\n month -= 12;\n year++;\n }\n\n tmp =\n inLeapYear && month === 2 ? daysInLeapFeburary : daysInMonth[month - 1];\n }\n\n //If UTC offset is at the beginning/end of the day, minutes can be negative.\n while (minute < 0) {\n minute += 60;\n hour--;\n }\n\n while (hour < 0) {\n hour += 24;\n day--;\n }\n\n while (day < 1) {\n month--;\n if (month < 1) {\n month += 12;\n year--;\n }\n\n tmp =\n inLeapYear && month === 2 ? daysInLeapFeburary : daysInMonth[month - 1];\n day += tmp;\n }\n\n //Now create the JulianDate components from the Gregorian date and actually create our instance.\n const components = computeJulianDateComponents(\n year,\n month,\n day,\n hour,\n minute,\n second,\n millisecond,\n );\n\n if (!defined(result)) {\n result = new JulianDate(components[0], components[1], TimeStandard.UTC);\n } else {\n setComponents(components[0], components[1], result);\n convertUtcToTai(result);\n }\n\n //If we were on a leap second, add it back.\n if (isLeapSecond) {\n JulianDate.addSeconds(result, 1, result);\n }\n\n return result;\n};\n\n/**\n * Creates a new instance that represents the current system time.\n * This is equivalent to calling JulianDate.fromDate(new Date());
.\n *\n * @param {JulianDate} [result] An existing instance to use for the result.\n * @returns {JulianDate} The modified result parameter or a new instance if none was provided.\n */\nJulianDate.now = function (result) {\n return JulianDate.fromDate(new Date(), result);\n};\n\nconst toGregorianDateScratch = new JulianDate(0, 0, TimeStandard.TAI);\n\n/**\n * Creates a {@link GregorianDate} from the provided instance.\n *\n * @param {JulianDate} julianDate The date to be converted.\n * @param {GregorianDate} [result] An existing instance to use for the result.\n * @returns {GregorianDate} The modified result parameter or a new instance if none was provided.\n */\nJulianDate.toGregorianDate = function (julianDate, result) {\n //>>includeStart('debug', pragmas.debug);\n if (!defined(julianDate)) {\n throw new DeveloperError(\"julianDate is required.\");\n }\n //>>includeEnd('debug');\n\n let isLeapSecond = false;\n let thisUtc = convertTaiToUtc(julianDate, toGregorianDateScratch);\n if (!defined(thisUtc)) {\n //Conversion to UTC will fail if we are during a leap second.\n //If that's the case, subtract a second and convert again.\n //JavaScript doesn't support leap seconds, so this results in second 59 being repeated twice.\n JulianDate.addSeconds(julianDate, -1, toGregorianDateScratch);\n thisUtc = convertTaiToUtc(toGregorianDateScratch, toGregorianDateScratch);\n isLeapSecond = true;\n }\n\n let julianDayNumber = thisUtc.dayNumber;\n const secondsOfDay = thisUtc.secondsOfDay;\n\n if (secondsOfDay >= 43200.0) {\n julianDayNumber += 1;\n }\n\n // Algorithm from page 604 of the Explanatory Supplement to the\n // Astronomical Almanac (Seidelmann 1992).\n let L = (julianDayNumber + 68569) | 0;\n const N = ((4 * L) / 146097) | 0;\n L = (L - (((146097 * N + 3) / 4) | 0)) | 0;\n const I = ((4000 * (L + 1)) / 1461001) | 0;\n L = (L - (((1461 * I) / 4) | 0) + 31) | 0;\n const J = ((80 * L) / 2447) | 0;\n const day = (L - (((2447 * J) / 80) | 0)) | 0;\n L = (J / 11) | 0;\n const month = (J + 2 - 12 * L) | 0;\n const year = (100 * (N - 49) + I + L) | 0;\n\n let hour = (secondsOfDay / TimeConstants.SECONDS_PER_HOUR) | 0;\n let remainingSeconds = secondsOfDay - hour * TimeConstants.SECONDS_PER_HOUR;\n const minute = (remainingSeconds / TimeConstants.SECONDS_PER_MINUTE) | 0;\n remainingSeconds =\n remainingSeconds - minute * TimeConstants.SECONDS_PER_MINUTE;\n let second = remainingSeconds | 0;\n const millisecond =\n (remainingSeconds - second) / TimeConstants.SECONDS_PER_MILLISECOND;\n\n // JulianDates are noon-based\n hour += 12;\n if (hour > 23) {\n hour -= 24;\n }\n\n //If we were on a leap second, add it back.\n if (isLeapSecond) {\n second += 1;\n }\n\n if (!defined(result)) {\n return new GregorianDate(\n year,\n month,\n day,\n hour,\n minute,\n second,\n millisecond,\n isLeapSecond,\n );\n }\n\n result.year = year;\n result.month = month;\n result.day = day;\n result.hour = hour;\n result.minute = minute;\n result.second = second;\n result.millisecond = millisecond;\n result.isLeapSecond = isLeapSecond;\n return result;\n};\n\n/**\n * Creates a JavaScript Date from the provided instance.\n * Since JavaScript dates are only accurate to the nearest millisecond and\n * cannot represent a leap second, consider using {@link JulianDate.toGregorianDate} instead.\n * If the provided JulianDate is during a leap second, the previous second is used.\n *\n * @param {JulianDate} julianDate The date to be converted.\n * @returns {Date} A new instance representing the provided date.\n */\nJulianDate.toDate = function (julianDate) {\n //>>includeStart('debug', pragmas.debug);\n if (!defined(julianDate)) {\n throw new DeveloperError(\"julianDate is required.\");\n }\n //>>includeEnd('debug');\n\n const gDate = JulianDate.toGregorianDate(julianDate, gregorianDateScratch);\n let second = gDate.second;\n if (gDate.isLeapSecond) {\n second -= 1;\n }\n return new Date(\n Date.UTC(\n gDate.year,\n gDate.month - 1,\n gDate.day,\n gDate.hour,\n gDate.minute,\n second,\n gDate.millisecond,\n ),\n );\n};\n\n/**\n * Creates an ISO8601 representation of the provided date.\n *\n * @param {JulianDate} julianDate The date to be converted.\n * @param {number} [precision] The number of fractional digits used to represent the seconds component. By default, the most precise representation is used.\n * @returns {string} The ISO8601 representation of the provided date.\n */\nJulianDate.toIso8601 = function (julianDate, precision) {\n //>>includeStart('debug', pragmas.debug);\n if (!defined(julianDate)) {\n throw new DeveloperError(\"julianDate is required.\");\n }\n //>>includeEnd('debug');\n\n const gDate = JulianDate.toGregorianDate(julianDate, gregorianDateScratch);\n let year = gDate.year;\n let month = gDate.month;\n let day = gDate.day;\n let hour = gDate.hour;\n const minute = gDate.minute;\n const second = gDate.second;\n const millisecond = gDate.millisecond;\n\n // special case - Iso8601.MAXIMUM_VALUE produces a string which we can't parse unless we adjust.\n // 10000-01-01T00:00:00 is the same instant as 9999-12-31T24:00:00\n if (\n year === 10000 &&\n month === 1 &&\n day === 1 &&\n hour === 0 &&\n minute === 0 &&\n second === 0 &&\n millisecond === 0\n ) {\n year = 9999;\n month = 12;\n day = 31;\n hour = 24;\n }\n\n let millisecondStr;\n\n if (!defined(precision) && millisecond !== 0) {\n //Forces milliseconds into a number with at least 3 digits to whatever the default toString() precision is.\n millisecondStr = (millisecond * 0.01).toString().replace(\".\", \"\");\n return `${year.toString().padStart(4, \"0\")}-${month\n .toString()\n .padStart(2, \"0\")}-${day.toString().padStart(2, \"0\")}T${hour\n .toString()\n .padStart(2, \"0\")}:${minute.toString().padStart(2, \"0\")}:${second\n .toString()\n .padStart(2, \"0\")}.${millisecondStr}Z`;\n }\n\n //Precision is either 0 or milliseconds is 0 with undefined precision, in either case, leave off milliseconds entirely\n if (!defined(precision) || precision === 0) {\n return `${year.toString().padStart(4, \"0\")}-${month\n .toString()\n .padStart(2, \"0\")}-${day.toString().padStart(2, \"0\")}T${hour\n .toString()\n .padStart(2, \"0\")}:${minute\n .toString()\n .padStart(2, \"0\")}:${second.toString().padStart(2, \"0\")}Z`;\n }\n\n //Forces milliseconds into a number with at least 3 digits to whatever the specified precision is.\n millisecondStr = (millisecond * 0.01)\n .toFixed(precision)\n .replace(\".\", \"\")\n .slice(0, precision);\n return `${year.toString().padStart(4, \"0\")}-${month\n .toString()\n .padStart(2, \"0\")}-${day.toString().padStart(2, \"0\")}T${hour\n .toString()\n .padStart(2, \"0\")}:${minute.toString().padStart(2, \"0\")}:${second\n .toString()\n .padStart(2, \"0\")}.${millisecondStr}Z`;\n};\n\n/**\n * Duplicates a JulianDate instance.\n *\n * @param {JulianDate} julianDate The date to duplicate.\n * @param {JulianDate} [result] An existing instance to use for the result.\n * @returns {JulianDate} The modified result parameter or a new instance if none was provided. Returns undefined if julianDate is undefined.\n */\nJulianDate.clone = function (julianDate, result) {\n if (!defined(julianDate)) {\n return undefined;\n }\n if (!defined(result)) {\n return new JulianDate(\n julianDate.dayNumber,\n julianDate.secondsOfDay,\n TimeStandard.TAI,\n );\n }\n result.dayNumber = julianDate.dayNumber;\n result.secondsOfDay = julianDate.secondsOfDay;\n return result;\n};\n\n/**\n * Compares two instances.\n *\n * @param {JulianDate} left The first instance.\n * @param {JulianDate} right The second instance.\n * @returns {number} 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.\n */\nJulianDate.compare = function (left, right) {\n //>>includeStart('debug', pragmas.debug);\n if (!defined(left)) {\n throw new DeveloperError(\"left is required.\");\n }\n if (!defined(right)) {\n throw new DeveloperError(\"right is required.\");\n }\n //>>includeEnd('debug');\n\n const julianDayNumberDifference = left.dayNumber - right.dayNumber;\n if (julianDayNumberDifference !== 0) {\n return julianDayNumberDifference;\n }\n return left.secondsOfDay - right.secondsOfDay;\n};\n\n/**\n * Compares two instances and returns true
if they are equal, false
otherwise.\n *\n * @param {JulianDate} [left] The first instance.\n * @param {JulianDate} [right] The second instance.\n * @returns {boolean} true
if the dates are equal; otherwise, false
.\n */\nJulianDate.equals = function (left, right) {\n return (\n left === right ||\n (defined(left) &&\n defined(right) &&\n left.dayNumber === right.dayNumber &&\n left.secondsOfDay === right.secondsOfDay)\n );\n};\n\n/**\n * Compares two instances and returns true
if they are within epsilon
seconds of\n * each other. That is, in order for the dates to be considered equal (and for\n * this function to return true
), the absolute value of the difference between them, in\n * seconds, must be less than epsilon
.\n *\n * @param {JulianDate} [left] The first instance.\n * @param {JulianDate} [right] The second instance.\n * @param {number} [epsilon=0] The maximum number of seconds that should separate the two instances.\n * @returns {boolean} true
if the two dates are within epsilon
seconds of each other; otherwise false
.\n */\nJulianDate.equalsEpsilon = function (left, right, epsilon) {\n epsilon = defaultValue(epsilon, 0);\n\n return (\n left === right ||\n (defined(left) &&\n defined(right) &&\n Math.abs(JulianDate.secondsDifference(left, right)) <= epsilon)\n );\n};\n\n/**\n * Computes the total number of whole and fractional days represented by the provided instance.\n *\n * @param {JulianDate} julianDate The date.\n * @returns {number} The Julian date as single floating point number.\n */\nJulianDate.totalDays = function (julianDate) {\n //>>includeStart('debug', pragmas.debug);\n if (!defined(julianDate)) {\n throw new DeveloperError(\"julianDate is required.\");\n }\n //>>includeEnd('debug');\n return (\n julianDate.dayNumber +\n julianDate.secondsOfDay / TimeConstants.SECONDS_PER_DAY\n );\n};\n\n/**\n * Computes the difference in seconds between the provided instance.\n *\n * @param {JulianDate} left The first instance.\n * @param {JulianDate} right The second instance.\n * @returns {number} The difference, in seconds, when subtracting right
from left
.\n */\nJulianDate.secondsDifference = function (left, right) {\n //>>includeStart('debug', pragmas.debug);\n if (!defined(left)) {\n throw new DeveloperError(\"left is required.\");\n }\n if (!defined(right)) {\n throw new DeveloperError(\"right is required.\");\n }\n //>>includeEnd('debug');\n\n const dayDifference =\n (left.dayNumber - right.dayNumber) * TimeConstants.SECONDS_PER_DAY;\n return dayDifference + (left.secondsOfDay - right.secondsOfDay);\n};\n\n/**\n * Computes the difference in days between the provided instance.\n *\n * @param {JulianDate} left The first instance.\n * @param {JulianDate} right The second instance.\n * @returns {number} The difference, in days, when subtracting right
from left
.\n */\nJulianDate.daysDifference = function (left, right) {\n //>>includeStart('debug', pragmas.debug);\n if (!defined(left)) {\n throw new DeveloperError(\"left is required.\");\n }\n if (!defined(right)) {\n throw new DeveloperError(\"right is required.\");\n }\n //>>includeEnd('debug');\n\n const dayDifference = left.dayNumber - right.dayNumber;\n const secondDifference =\n (left.secondsOfDay - right.secondsOfDay) / TimeConstants.SECONDS_PER_DAY;\n return dayDifference + secondDifference;\n};\n\n/**\n * Computes the number of seconds the provided instance is ahead of UTC.\n *\n * @param {JulianDate} julianDate The date.\n * @returns {number} The number of seconds the provided instance is ahead of UTC\n */\nJulianDate.computeTaiMinusUtc = function (julianDate) {\n binarySearchScratchLeapSecond.julianDate = julianDate;\n const leapSeconds = JulianDate.leapSeconds;\n let index = binarySearch(\n leapSeconds,\n binarySearchScratchLeapSecond,\n compareLeapSecondDates,\n );\n if (index < 0) {\n index = ~index;\n --index;\n if (index < 0) {\n index = 0;\n }\n }\n return leapSeconds[index].offset;\n};\n\n/**\n * Adds the provided number of seconds to the provided date instance.\n *\n * @param {JulianDate} julianDate The date.\n * @param {number} seconds The number of seconds to add or subtract.\n * @param {JulianDate} result An existing instance to use for the result.\n * @returns {JulianDate} The modified result parameter.\n */\nJulianDate.addSeconds = function (julianDate, seconds, result) {\n //>>includeStart('debug', pragmas.debug);\n if (!defined(julianDate)) {\n throw new DeveloperError(\"julianDate is required.\");\n }\n if (!defined(seconds)) {\n throw new DeveloperError(\"seconds is required.\");\n }\n if (!defined(result)) {\n throw new DeveloperError(\"result is required.\");\n }\n //>>includeEnd('debug');\n\n return setComponents(\n julianDate.dayNumber,\n julianDate.secondsOfDay + seconds,\n result,\n );\n};\n\n/**\n * Adds the provided number of minutes to the provided date instance.\n *\n * @param {JulianDate} julianDate The date.\n * @param {number} minutes The number of minutes to add or subtract.\n * @param {JulianDate} result An existing instance to use for the result.\n * @returns {JulianDate} The modified result parameter.\n */\nJulianDate.addMinutes = function (julianDate, minutes, result) {\n //>>includeStart('debug', pragmas.debug);\n if (!defined(julianDate)) {\n throw new DeveloperError(\"julianDate is required.\");\n }\n if (!defined(minutes)) {\n throw new DeveloperError(\"minutes is required.\");\n }\n if (!defined(result)) {\n throw new DeveloperError(\"result is required.\");\n }\n //>>includeEnd('debug');\n\n const newSecondsOfDay =\n julianDate.secondsOfDay + minutes * TimeConstants.SECONDS_PER_MINUTE;\n return setComponents(julianDate.dayNumber, newSecondsOfDay, result);\n};\n\n/**\n * Adds the provided number of hours to the provided date instance.\n *\n * @param {JulianDate} julianDate The date.\n * @param {number} hours The number of hours to add or subtract.\n * @param {JulianDate} result An existing instance to use for the result.\n * @returns {JulianDate} The modified result parameter.\n */\nJulianDate.addHours = function (julianDate, hours, result) {\n //>>includeStart('debug', pragmas.debug);\n if (!defined(julianDate)) {\n throw new DeveloperError(\"julianDate is required.\");\n }\n if (!defined(hours)) {\n throw new DeveloperError(\"hours is required.\");\n }\n if (!defined(result)) {\n throw new DeveloperError(\"result is required.\");\n }\n //>>includeEnd('debug');\n\n const newSecondsOfDay =\n julianDate.secondsOfDay + hours * TimeConstants.SECONDS_PER_HOUR;\n return setComponents(julianDate.dayNumber, newSecondsOfDay, result);\n};\n\n/**\n * Adds the provided number of days to the provided date instance.\n *\n * @param {JulianDate} julianDate The date.\n * @param {number} days The number of days to add or subtract.\n * @param {JulianDate} result An existing instance to use for the result.\n * @returns {JulianDate} The modified result parameter.\n */\nJulianDate.addDays = function (julianDate, days, result) {\n //>>includeStart('debug', pragmas.debug);\n if (!defined(julianDate)) {\n throw new DeveloperError(\"julianDate is required.\");\n }\n if (!defined(days)) {\n throw new DeveloperError(\"days is required.\");\n }\n if (!defined(result)) {\n throw new DeveloperError(\"result is required.\");\n }\n //>>includeEnd('debug');\n\n const newJulianDayNumber = julianDate.dayNumber + days;\n return setComponents(newJulianDayNumber, julianDate.secondsOfDay, result);\n};\n\n/**\n * Compares the provided instances and returns true
if left
is earlier than right
, false
otherwise.\n *\n * @param {JulianDate} left The first instance.\n * @param {JulianDate} right The second instance.\n * @returns {boolean} true
if left
is earlier than right
, false
otherwise.\n */\nJulianDate.lessThan = function (left, right) {\n return JulianDate.compare(left, right) < 0;\n};\n\n/**\n * Compares the provided instances and returns true
if left
is earlier than or equal to right
, false
otherwise.\n *\n * @param {JulianDate} left The first instance.\n * @param {JulianDate} right The second instance.\n * @returns {boolean} true
if left
is earlier than or equal to right
, false
otherwise.\n */\nJulianDate.lessThanOrEquals = function (left, right) {\n return JulianDate.compare(left, right) <= 0;\n};\n\n/**\n * Compares the provided instances and returns true
if left
is later than right
, false
otherwise.\n *\n * @param {JulianDate} left The first instance.\n * @param {JulianDate} right The second instance.\n * @returns {boolean} true
if left
is later than right
, false
otherwise.\n */\nJulianDate.greaterThan = function (left, right) {\n return JulianDate.compare(left, right) > 0;\n};\n\n/**\n * Compares the provided instances and returns true
if left
is later than or equal to right
, false
otherwise.\n *\n * @param {JulianDate} left The first instance.\n * @param {JulianDate} right The second instance.\n * @returns {boolean} true
if left
is later than or equal to right
, false
otherwise.\n */\nJulianDate.greaterThanOrEquals = function (left, right) {\n return JulianDate.compare(left, right) >= 0;\n};\n\n/**\n * Duplicates this instance.\n *\n * @param {JulianDate} [result] An existing instance to use for the result.\n * @returns {JulianDate} The modified result parameter or a new instance if none was provided.\n */\nJulianDate.prototype.clone = function (result) {\n return JulianDate.clone(this, result);\n};\n\n/**\n * Compares this and the provided instance and returns true
if they are equal, false
otherwise.\n *\n * @param {JulianDate} [right] The second instance.\n * @returns {boolean} true
if the dates are equal; otherwise, false
.\n */\nJulianDate.prototype.equals = function (right) {\n return JulianDate.equals(this, right);\n};\n\n/**\n * Compares this and the provided instance and returns true
if they are within epsilon
seconds of\n * each other. That is, in order for the dates to be considered equal (and for\n * this function to return true
), the absolute value of the difference between them, in\n * seconds, must be less than epsilon
.\n *\n * @param {JulianDate} [right] The second instance.\n * @param {number} [epsilon=0] The maximum number of seconds that should separate the two instances.\n * @returns {boolean} true
if the two dates are within epsilon
seconds of each other; otherwise false
.\n */\nJulianDate.prototype.equalsEpsilon = function (right, epsilon) {\n return JulianDate.equalsEpsilon(this, right, epsilon);\n};\n\n/**\n * Creates a string representing this date in ISO8601 format.\n *\n * @returns {string} A string representing this date in ISO8601 format.\n */\nJulianDate.prototype.toString = function () {\n return JulianDate.toIso8601(this);\n};\n\n/**\n * Gets or sets the list of leap seconds used throughout Cesium.\n * @memberof JulianDate\n * @type {LeapSecond[]}\n */\nJulianDate.leapSeconds = [\n new LeapSecond(new JulianDate(2441317, 43210.0, TimeStandard.TAI), 10), // January 1, 1972 00:00:00 UTC\n new LeapSecond(new JulianDate(2441499, 43211.0, TimeStandard.TAI), 11), // July 1, 1972 00:00:00 UTC\n new LeapSecond(new JulianDate(2441683, 43212.0, TimeStandard.TAI), 12), // January 1, 1973 00:00:00 UTC\n new LeapSecond(new JulianDate(2442048, 43213.0, TimeStandard.TAI), 13), // January 1, 1974 00:00:00 UTC\n new LeapSecond(new JulianDate(2442413, 43214.0, TimeStandard.TAI), 14), // January 1, 1975 00:00:00 UTC\n new LeapSecond(new JulianDate(2442778, 43215.0, TimeStandard.TAI), 15), // January 1, 1976 00:00:00 UTC\n new LeapSecond(new JulianDate(2443144, 43216.0, TimeStandard.TAI), 16), // January 1, 1977 00:00:00 UTC\n new LeapSecond(new JulianDate(2443509, 43217.0, TimeStandard.TAI), 17), // January 1, 1978 00:00:00 UTC\n new LeapSecond(new JulianDate(2443874, 43218.0, TimeStandard.TAI), 18), // January 1, 1979 00:00:00 UTC\n new LeapSecond(new JulianDate(2444239, 43219.0, TimeStandard.TAI), 19), // January 1, 1980 00:00:00 UTC\n new LeapSecond(new JulianDate(2444786, 43220.0, TimeStandard.TAI), 20), // July 1, 1981 00:00:00 UTC\n new LeapSecond(new JulianDate(2445151, 43221.0, TimeStandard.TAI), 21), // July 1, 1982 00:00:00 UTC\n new LeapSecond(new JulianDate(2445516, 43222.0, TimeStandard.TAI), 22), // July 1, 1983 00:00:00 UTC\n new LeapSecond(new JulianDate(2446247, 43223.0, TimeStandard.TAI), 23), // July 1, 1985 00:00:00 UTC\n new LeapSecond(new JulianDate(2447161, 43224.0, TimeStandard.TAI), 24), // January 1, 1988 00:00:00 UTC\n new LeapSecond(new JulianDate(2447892, 43225.0, TimeStandard.TAI), 25), // January 1, 1990 00:00:00 UTC\n new LeapSecond(new JulianDate(2448257, 43226.0, TimeStandard.TAI), 26), // January 1, 1991 00:00:00 UTC\n new LeapSecond(new JulianDate(2448804, 43227.0, TimeStandard.TAI), 27), // July 1, 1992 00:00:00 UTC\n new LeapSecond(new JulianDate(2449169, 43228.0, TimeStandard.TAI), 28), // July 1, 1993 00:00:00 UTC\n new LeapSecond(new JulianDate(2449534, 43229.0, TimeStandard.TAI), 29), // July 1, 1994 00:00:00 UTC\n new LeapSecond(new JulianDate(2450083, 43230.0, TimeStandard.TAI), 30), // January 1, 1996 00:00:00 UTC\n new LeapSecond(new JulianDate(2450630, 43231.0, TimeStandard.TAI), 31), // July 1, 1997 00:00:00 UTC\n new LeapSecond(new JulianDate(2451179, 43232.0, TimeStandard.TAI), 32), // January 1, 1999 00:00:00 UTC\n new LeapSecond(new JulianDate(2453736, 43233.0, TimeStandard.TAI), 33), // January 1, 2006 00:00:00 UTC\n new LeapSecond(new JulianDate(2454832, 43234.0, TimeStandard.TAI), 34), // January 1, 2009 00:00:00 UTC\n new LeapSecond(new JulianDate(2456109, 43235.0, TimeStandard.TAI), 35), // July 1, 2012 00:00:00 UTC\n new LeapSecond(new JulianDate(2457204, 43236.0, TimeStandard.TAI), 36), // July 1, 2015 00:00:00 UTC\n new LeapSecond(new JulianDate(2457754, 43237.0, TimeStandard.TAI), 37), // January 1, 2017 00:00:00 UTC\n];\nexport default JulianDate;\n","import Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport isLeapYear from \"./isLeapYear.js\";\n\nconst daysInYear = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\n\n/**\n * Represents a Gregorian date in a more precise format than the JavaScript Date object.\n * In addition to submillisecond precision, this object can also represent leap seconds.\n * @alias GregorianDate\n * @constructor\n *\n * @param {number} [year] The year as a whole number.\n * @param {number} [month] The month as a whole number with range [1, 12].\n * @param {number} [day] The day of the month as a whole number starting at 1.\n * @param {number} [hour] The hour as a whole number with range [0, 23].\n * @param {number} [minute] The minute of the hour as a whole number with range [0, 59].\n * @param {number} [second] The second of the minute as a whole number with range [0, 60], with 60 representing a leap second.\n * @param {number} [millisecond] The millisecond of the second as a floating point number with range [0.0, 1000.0).\n * @param {boolean} [isLeapSecond] Whether this time is during a leap second.\n *\n * @see JulianDate#toGregorianDate\n */\nfunction GregorianDate(\n year,\n month,\n day,\n hour,\n minute,\n second,\n millisecond,\n isLeapSecond,\n) {\n const minimumYear = 1;\n const minimumMonth = 1;\n const minimumDay = 1;\n const minimumHour = 0;\n const minimumMinute = 0;\n const minimumSecond = 0;\n const minimumMillisecond = 0;\n\n year = defaultValue(year, minimumYear);\n month = defaultValue(month, minimumMonth);\n day = defaultValue(day, minimumDay);\n hour = defaultValue(hour, minimumHour);\n minute = defaultValue(minute, minimumMinute);\n second = defaultValue(second, minimumSecond);\n millisecond = defaultValue(millisecond, minimumMillisecond);\n isLeapSecond = defaultValue(isLeapSecond, false);\n //>>includeStart('debug', pragmas.debug);\n validateRange();\n validateDate();\n //>>includeEnd('debug');\n\n /**\n * Gets or sets the year as a whole number.\n * @type {number}\n */\n this.year = year;\n /**\n * Gets or sets the month as a whole number with range [1, 12].\n * @type {number}\n */\n this.month = month;\n /**\n * Gets or sets the day of the month as a whole number starting at 1.\n * @type {number}\n */\n this.day = day;\n /**\n * Gets or sets the hour as a whole number with range [0, 23].\n * @type {number}\n */\n this.hour = hour;\n /**\n * Gets or sets the minute of the hour as a whole number with range [0, 59].\n * @type {number}\n */\n this.minute = minute;\n /**\n * Gets or sets the second of the minute as a whole number with range [0, 60], with 60 representing a leap second.\n * @type {number}\n */\n this.second = second;\n /**\n * Gets or sets the millisecond of the second as a floating point number with range [0.0, 1000.0).\n * @type {number}\n */\n this.millisecond = millisecond;\n /**\n * Gets or sets whether this time is during a leap second.\n * @type {boolean}\n */\n this.isLeapSecond = isLeapSecond;\n\n function validateRange() {\n const maximumYear = 9999;\n const maximumMonth = 12;\n const maximumDay = 31;\n const maximumHour = 23;\n const maximumMinute = 59;\n const maximumSecond = 59;\n const excludedMaximumMilisecond = 1000;\n\n Check.typeOf.number.greaterThanOrEquals(\"Year\", year, minimumYear);\n Check.typeOf.number.lessThanOrEquals(\"Year\", year, maximumYear);\n\n Check.typeOf.number.greaterThanOrEquals(\"Month\", month, minimumMonth);\n Check.typeOf.number.lessThanOrEquals(\"Month\", month, maximumMonth);\n\n Check.typeOf.number.greaterThanOrEquals(\"Day\", day, minimumDay);\n Check.typeOf.number.lessThanOrEquals(\"Day\", day, maximumDay);\n\n Check.typeOf.number.greaterThanOrEquals(\"Hour\", hour, minimumHour);\n Check.typeOf.number.lessThanOrEquals(\"Hour\", hour, maximumHour);\n\n Check.typeOf.number.greaterThanOrEquals(\"Minute\", minute, minimumMinute);\n Check.typeOf.number.lessThanOrEquals(\"Minute\", minute, maximumMinute);\n\n Check.typeOf.bool(\"IsLeapSecond\", isLeapSecond);\n\n Check.typeOf.number.greaterThanOrEquals(\"Second\", second, minimumSecond);\n Check.typeOf.number.lessThanOrEquals(\n \"Second\",\n second,\n isLeapSecond ? maximumSecond + 1 : maximumSecond,\n );\n\n Check.typeOf.number.greaterThanOrEquals(\n \"Millisecond\",\n millisecond,\n minimumMillisecond,\n );\n Check.typeOf.number.lessThan(\n \"Millisecond\",\n millisecond,\n excludedMaximumMilisecond,\n );\n }\n\n // Javascript date object supports only dates greater than 1901. Thus validating with custom logic\n function validateDate() {\n const daysInMonth =\n month === 2 && isLeapYear(year)\n ? daysInYear[month - 1] + 1\n : daysInYear[month - 1];\n\n if (day > daysInMonth) {\n throw new DeveloperError(\"Month and Day represents invalid date\");\n }\n }\n}\nexport default GregorianDate;\n","import DeveloperError from \"./DeveloperError.js\";\n\n/**\n * Determines if a given date is a leap year.\n *\n * @function isLeapYear\n *\n * @param {number} year The year to be tested.\n * @returns {boolean} True if year
is a leap year.\n *\n * @example\n * const leapYear = Cesium.isLeapYear(2000); // true\n */\nfunction isLeapYear(year) {\n //>>includeStart('debug', pragmas.debug);\n if (year === null || isNaN(year)) {\n throw new DeveloperError(\"year is required and must be a number.\");\n }\n //>>includeEnd('debug');\n\n return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;\n}\nexport default isLeapYear;\n","/**\n * Describes a single leap second, which is constructed from a {@link JulianDate} and a\n * numerical offset representing the number of seconds TAI is ahead of the UTC time standard.\n * @alias LeapSecond\n * @constructor\n *\n * @param {JulianDate} [date] A Julian date representing the time of the leap second.\n * @param {number} [offset] The cumulative number of seconds that TAI is ahead of UTC at the provided date.\n */\nfunction LeapSecond(date, offset) {\n /**\n * Gets or sets the date at which this leap second occurs.\n * @type {JulianDate}\n */\n this.julianDate = date;\n\n /**\n * Gets or sets the cumulative number of seconds between the UTC and TAI time standards at the time\n * of this leap second.\n * @type {number}\n */\n this.offset = offset;\n}\nexport default LeapSecond;\n","/**\n * Constants for time conversions like those done by {@link JulianDate}.\n *\n * @namespace TimeConstants\n *\n * @see JulianDate\n *\n * @private\n */\nconst TimeConstants = {\n /**\n * The number of seconds in one millisecond: 0.001
\n * @type {number}\n * @constant\n */\n SECONDS_PER_MILLISECOND: 0.001,\n\n /**\n * The number of seconds in one minute: 60
.\n * @type {number}\n * @constant\n */\n SECONDS_PER_MINUTE: 60.0,\n\n /**\n * The number of minutes in one hour: 60
.\n * @type {number}\n * @constant\n */\n MINUTES_PER_HOUR: 60.0,\n\n /**\n * The number of hours in one day: 24
.\n * @type {number}\n * @constant\n */\n HOURS_PER_DAY: 24.0,\n\n /**\n * The number of seconds in one hour: 3600
.\n * @type {number}\n * @constant\n */\n SECONDS_PER_HOUR: 3600.0,\n\n /**\n * The number of minutes in one day: 1440
.\n * @type {number}\n * @constant\n */\n MINUTES_PER_DAY: 1440.0,\n\n /**\n * The number of seconds in one day, ignoring leap seconds: 86400
.\n * @type {number}\n * @constant\n */\n SECONDS_PER_DAY: 86400.0,\n\n /**\n * The number of days in one Julian century: 36525
.\n * @type {number}\n * @constant\n */\n DAYS_PER_JULIAN_CENTURY: 36525.0,\n\n /**\n * One trillionth of a second.\n * @type {number}\n * @constant\n */\n PICOSECOND: 0.000000001,\n\n /**\n * The number of days to subtract from a Julian date to determine the\n * modified Julian date, which gives the number of days since midnight\n * on November 17, 1858.\n * @type {number}\n * @constant\n */\n MODIFIED_JULIAN_DATE_DIFFERENCE: 2400000.5,\n};\nexport default Object.freeze(TimeConstants);\n","/**\n * Provides the type of time standards which JulianDate can take as input.\n *\n * @enum {number}\n *\n * @see JulianDate\n */\nconst TimeStandard = {\n /**\n * Represents the coordinated Universal Time (UTC) time standard.\n *\n * UTC is related to TAI according to the relationship\n * UTC = TAI - deltaT
where deltaT
is the number of leap\n * seconds which have been introduced as of the time in TAI.\n *\n * @type {number}\n * @constant\n */\n UTC: 0,\n\n /**\n * Represents the International Atomic Time (TAI) time standard.\n * TAI is the principal time standard to which the other time standards are related.\n *\n * @type {number}\n * @constant\n */\n TAI: 1,\n};\nexport default Object.freeze(TimeStandard);\n","import Uri from \"urijs\";\nimport appendForwardSlash from \"./appendForwardSlash.js\";\nimport Check from \"./Check.js\";\nimport clone from \"./clone.js\";\nimport combine from \"./combine.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defer from \"./defer.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport getAbsoluteUri from \"./getAbsoluteUri.js\";\nimport getBaseUri from \"./getBaseUri.js\";\nimport getExtensionFromUri from \"./getExtensionFromUri.js\";\nimport getImagePixels from \"./getImagePixels.js\";\nimport isBlobUri from \"./isBlobUri.js\";\nimport isCrossOriginUrl from \"./isCrossOriginUrl.js\";\nimport isDataUri from \"./isDataUri.js\";\nimport loadAndExecuteScript from \"./loadAndExecuteScript.js\";\nimport CesiumMath from \"./Math.js\";\nimport objectToQuery from \"./objectToQuery.js\";\nimport queryToObject from \"./queryToObject.js\";\nimport Request from \"./Request.js\";\nimport RequestErrorEvent from \"./RequestErrorEvent.js\";\nimport RequestScheduler from \"./RequestScheduler.js\";\nimport RequestState from \"./RequestState.js\";\nimport RuntimeError from \"./RuntimeError.js\";\nimport TrustedServers from \"./TrustedServers.js\";\n\nconst xhrBlobSupported = (function () {\n try {\n const xhr = new XMLHttpRequest();\n xhr.open(\"GET\", \"#\", true);\n xhr.responseType = \"blob\";\n return xhr.responseType === \"blob\";\n } catch (e) {\n return false;\n }\n})();\n\n/**\n * @typedef {object} Resource.ConstructorOptions\n *\n * Initialization options for the Resource constructor\n *\n * @property {string} url The url of the resource.\n * @property {object} [queryParameters] An object containing query parameters that will be sent when retrieving the resource.\n * @property {object} [templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\n * @property {object} [headers={}] Additional HTTP headers that will be sent.\n * @property {Proxy} [proxy] A proxy to be used when loading the resource.\n * @property {Resource.RetryCallback} [retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\n * @property {number} [retryAttempts=0] The number of times the retryCallback should be called before giving up.\n * @property {Request} [request] A Request object that will be used. Intended for internal use only.\n * @property {boolean} [parseUrl=true] If true, parse the url for query parameters; otherwise store the url without change\n */\n\n/**\n * 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.\n *\n * @alias Resource\n * @constructor\n *\n * @param {string|Resource.ConstructorOptions} options A url or an object describing initialization options\n *\n * @example\n * function refreshTokenRetryCallback(resource, error) {\n * if (error.statusCode === 403) {\n * // 403 status code means a new token should be generated\n * return getNewAccessToken()\n * .then(function(token) {\n * resource.queryParameters.access_token = token;\n * return true;\n * })\n * .catch(function() {\n * return false;\n * });\n * }\n *\n * return false;\n * }\n *\n * const resource = new Resource({\n * url: 'http://server.com/path/to/resource.json',\n * proxy: new DefaultProxy('/proxy/'),\n * headers: {\n * 'X-My-Header': 'valueOfHeader'\n * },\n * queryParameters: {\n * 'access_token': '123-435-456-000'\n * },\n * retryCallback: refreshTokenRetryCallback,\n * retryAttempts: 1\n * });\n */\nfunction Resource(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n if (typeof options === \"string\") {\n options = {\n url: options,\n };\n }\n\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.string(\"options.url\", options.url);\n //>>includeEnd('debug');\n\n this._url = undefined;\n this._templateValues = defaultClone(options.templateValues, {});\n this._queryParameters = defaultClone(options.queryParameters, {});\n\n /**\n * Additional HTTP headers that will be sent with the request.\n *\n * @type {object}\n */\n this.headers = defaultClone(options.headers, {});\n\n /**\n * A Request object that will be used. Intended for internal use only.\n *\n * @type {Request}\n */\n this.request = defaultValue(options.request, new Request());\n\n /**\n * A proxy to be used when loading the resource.\n *\n * @type {Proxy}\n */\n this.proxy = options.proxy;\n\n /**\n * 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.\n *\n * @type {Function}\n */\n this.retryCallback = options.retryCallback;\n\n /**\n * The number of times the retryCallback should be called before giving up.\n *\n * @type {number}\n */\n this.retryAttempts = defaultValue(options.retryAttempts, 0);\n this._retryCount = 0;\n\n const parseUrl = defaultValue(options.parseUrl, true);\n if (parseUrl) {\n this.parseUrl(options.url, true, true);\n } else {\n this._url = options.url;\n }\n\n this._credits = options.credits;\n}\n\n/**\n * Clones a value if it is defined, otherwise returns the default value\n *\n * @param {object} [value] The value to clone.\n * @param {object} [defaultValue] The default value.\n *\n * @returns {object} A clone of value or the defaultValue.\n *\n * @private\n */\nfunction defaultClone(value, defaultValue) {\n return defined(value) ? clone(value) : defaultValue;\n}\n\n/**\n * A helper function to create a resource depending on whether we have a String or a Resource\n *\n * @param {Resource|string} resource A Resource or a String to use when creating a new Resource.\n *\n * @returns {Resource} If resource is a String, a Resource constructed with the url and options. Otherwise the resource parameter is returned.\n *\n * @private\n */\nResource.createIfNeeded = function (resource) {\n if (resource instanceof Resource) {\n // Keep existing request object. This function is used internally to duplicate a Resource, so that it can't\n // be modified outside of a class that holds it (eg. an imagery or terrain provider). Since the Request objects\n // are managed outside of the providers, by the tile loading code, we want to keep the request property the same so if it is changed\n // in the underlying tiling code the requests for this resource will use it.\n return resource.getDerivedResource({\n request: resource.request,\n });\n }\n\n if (typeof resource !== \"string\") {\n return resource;\n }\n\n return new Resource({\n url: resource,\n });\n};\n\nlet supportsImageBitmapOptionsPromise;\n/**\n * A helper function to check whether createImageBitmap supports passing ImageBitmapOptions.\n *\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n *\n * @example\n * // load a single URL asynchronously\n * resource.fetchArrayBuffer().then(function(arrayBuffer) {\n * // use the data\n * }).catch(function(error) {\n * // an error occurred\n * });\n *\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\n */\nResource.prototype.fetchArrayBuffer = function () {\n return this.fetch({\n responseType: \"arraybuffer\",\n });\n};\n\n/**\n * Creates a Resource and calls fetchArrayBuffer() on it.\n *\n * @param {string|object} options A url or an object with the following properties\n * @param {string} options.url The url of the resource.\n * @param {object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\n * @param {object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\n * @param {object} [options.headers={}] Additional HTTP headers that will be sent.\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\n * @param {number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n */\nResource.fetchArrayBuffer = function (options) {\n const resource = new Resource(options);\n return resource.fetchArrayBuffer();\n};\n\n/**\n * Asynchronously loads the given resource as a blob. Returns a promise that will resolve to\n * a Blob once loaded, or reject if the resource failed to load. The data is loaded\n * using XMLHttpRequest, which means that in order to make requests to another origin,\n * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.\n *\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n *\n * @example\n * // load a single URL asynchronously\n * resource.fetchBlob().then(function(blob) {\n * // use the data\n * }).catch(function(error) {\n * // an error occurred\n * });\n *\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\n */\nResource.prototype.fetchBlob = function () {\n return this.fetch({\n responseType: \"blob\",\n });\n};\n\n/**\n * Creates a Resource and calls fetchBlob() on it.\n *\n * @param {string|object} options A url or an object with the following properties\n * @param {string} options.url The url of the resource.\n * @param {object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\n * @param {object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\n * @param {object} [options.headers={}] Additional HTTP headers that will be sent.\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\n * @param {number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n */\nResource.fetchBlob = function (options) {\n const resource = new Resource(options);\n return resource.fetchBlob();\n};\n\n/**\n * Asynchronously loads the given image resource. Returns a promise that will resolve to\n * 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\n * {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement|Image} once loaded, or reject if the image failed to load.\n *\n * @param {object} [options] An object with the following properties.\n * @param {boolean} [options.preferBlob=false] If true, we will load the image via a blob.\n * @param {boolean} [options.preferImageBitmap=false] If true, image will be decoded during fetch and an ImageBitmap
is returned.\n * @param {boolean} [options.flipY=false] If true, image will be vertically flipped during decode. Only applies if the browser supports createImageBitmap
.\n * @param {boolean} [options.skipColorSpaceConversion=false] If true, any custom gamma or color profiles in the image will be ignored. Only applies if the browser supports createImageBitmap
.\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n *\n *\n * @example\n * // load a single image asynchronously\n * resource.fetchImage().then(function(image) {\n * // use the loaded image\n * }).catch(function(error) {\n * // an error occurred\n * });\n *\n * // load several images in parallel\n * Promise.all([resource1.fetchImage(), resource2.fetchImage()]).then(function(images) {\n * // images is an array containing all the loaded images\n * });\n *\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\n */\nResource.prototype.fetchImage = function (options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const preferImageBitmap = defaultValue(options.preferImageBitmap, false);\n const preferBlob = defaultValue(options.preferBlob, false);\n const flipY = defaultValue(options.flipY, false);\n const skipColorSpaceConversion = defaultValue(\n options.skipColorSpaceConversion,\n false,\n );\n\n checkAndResetRequest(this.request);\n // We try to load the image normally if\n // 1. Blobs aren't supported\n // 2. It's a data URI\n // 3. It's a blob URI\n // 4. It doesn't have request headers and we preferBlob is false\n if (\n !xhrBlobSupported ||\n this.isDataUri ||\n this.isBlobUri ||\n (!this.hasHeaders && !preferBlob)\n ) {\n return fetchImage({\n resource: this,\n flipY: flipY,\n skipColorSpaceConversion: skipColorSpaceConversion,\n preferImageBitmap: preferImageBitmap,\n });\n }\n\n const blobPromise = this.fetchBlob();\n if (!defined(blobPromise)) {\n return;\n }\n\n let supportsImageBitmap;\n let useImageBitmap;\n let generatedBlobResource;\n let generatedBlob;\n return Resource.supportsImageBitmapOptions()\n .then(function (result) {\n supportsImageBitmap = result;\n useImageBitmap = supportsImageBitmap && preferImageBitmap;\n return blobPromise;\n })\n .then(function (blob) {\n if (!defined(blob)) {\n return;\n }\n generatedBlob = blob;\n if (useImageBitmap) {\n return Resource.createImageBitmapFromBlob(blob, {\n flipY: flipY,\n premultiplyAlpha: false,\n skipColorSpaceConversion: skipColorSpaceConversion,\n });\n }\n const blobUrl = window.URL.createObjectURL(blob);\n generatedBlobResource = new Resource({\n url: blobUrl,\n });\n\n return fetchImage({\n resource: generatedBlobResource,\n flipY: flipY,\n skipColorSpaceConversion: skipColorSpaceConversion,\n preferImageBitmap: false,\n });\n })\n .then(function (image) {\n if (!defined(image)) {\n return;\n }\n\n // The blob object may be needed for use by a TileDiscardPolicy,\n // so attach it to the image.\n image.blob = generatedBlob;\n\n if (useImageBitmap) {\n return image;\n }\n\n window.URL.revokeObjectURL(generatedBlobResource.url);\n return image;\n })\n .catch(function (error) {\n if (defined(generatedBlobResource)) {\n window.URL.revokeObjectURL(generatedBlobResource.url);\n }\n\n // If the blob load succeeded but the image decode failed, attach the blob\n // to the error object for use by a TileDiscardPolicy.\n // In particular, BingMapsImageryProvider uses this to detect the\n // zero-length response that is returned when a tile is not available.\n error.blob = generatedBlob;\n\n return Promise.reject(error);\n });\n};\n\n/**\n * Fetches an image and returns a promise to it.\n *\n * @param {object} [options] An object with the following properties.\n * @param {Resource} [options.resource] Resource object that points to an image to fetch.\n * @param {boolean} [options.preferImageBitmap] If true, image will be decoded during fetch and an ImageBitmap
is returned.\n * @param {boolean} [options.flipY] If true, image will be vertically flipped during decode. Only applies if the browser supports createImageBitmap
.\n * @param {boolean} [options.skipColorSpaceConversion=false] If true, any custom gamma or color profiles in the image will be ignored. Only applies if the browser supports createImageBitmap
.\n * @private\n */\nfunction fetchImage(options) {\n const resource = options.resource;\n const flipY = options.flipY;\n const skipColorSpaceConversion = options.skipColorSpaceConversion;\n const preferImageBitmap = options.preferImageBitmap;\n\n const request = resource.request;\n request.url = resource.url;\n request.requestFunction = function () {\n let crossOrigin = false;\n\n // data URIs can't have crossorigin set.\n if (!resource.isDataUri && !resource.isBlobUri) {\n crossOrigin = resource.isCrossOriginUrl;\n }\n\n const deferred = defer();\n Resource._Implementations.createImage(\n request,\n crossOrigin,\n deferred,\n flipY,\n skipColorSpaceConversion,\n preferImageBitmap,\n );\n\n return deferred.promise;\n };\n\n const promise = RequestScheduler.request(request);\n if (!defined(promise)) {\n return;\n }\n\n return promise.catch(function (e) {\n // Don't retry cancelled or otherwise aborted requests\n if (request.state !== RequestState.FAILED) {\n return Promise.reject(e);\n }\n return resource.retryOnError(e).then(function (retry) {\n if (retry) {\n // Reset request so it can try again\n request.state = RequestState.UNISSUED;\n request.deferred = undefined;\n\n return fetchImage({\n resource: resource,\n flipY: flipY,\n skipColorSpaceConversion: skipColorSpaceConversion,\n preferImageBitmap: preferImageBitmap,\n });\n }\n return Promise.reject(e);\n });\n });\n}\n\n/**\n * Creates a Resource and calls fetchImage() on it.\n *\n * @param {string|object} options A url or an object with the following properties\n * @param {string} options.url The url of the resource.\n * @param {object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\n * @param {object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\n * @param {object} [options.headers={}] Additional HTTP headers that will be sent.\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\n * @param {boolean} [options.flipY=false] Whether to vertically flip the image during fetch and decode. Only applies when requesting an image and the browser supports createImageBitmap
.\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\n * @param {number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\n * @param {boolean} [options.preferBlob=false] If true, we will load the image via a blob.\n * @param {boolean} [options.preferImageBitmap=false] If true, image will be decoded during fetch and an ImageBitmap
is returned.\n * @param {boolean} [options.skipColorSpaceConversion=false] If true, any custom gamma or color profiles in the image will be ignored. Only applies when requesting an image and the browser supports createImageBitmap
.\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n */\nResource.fetchImage = function (options) {\n const resource = new Resource(options);\n return resource.fetchImage({\n flipY: options.flipY,\n skipColorSpaceConversion: options.skipColorSpaceConversion,\n preferBlob: options.preferBlob,\n preferImageBitmap: options.preferImageBitmap,\n });\n};\n\n/**\n * Asynchronously loads the given resource as text. Returns a promise that will resolve to\n * a String once loaded, or reject if the resource failed to load. The data is loaded\n * using XMLHttpRequest, which means that in order to make requests to another origin,\n * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.\n *\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n *\n * @example\n * // load text from a URL, setting a custom header\n * const resource = new Resource({\n * url: 'http://someUrl.com/someJson.txt',\n * headers: {\n * 'X-Custom-Header' : 'some value'\n * }\n * });\n * resource.fetchText().then(function(text) {\n * // Do something with the text\n * }).catch(function(error) {\n * // an error occurred\n * });\n *\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest|XMLHttpRequest}\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\n */\nResource.prototype.fetchText = function () {\n return this.fetch({\n responseType: \"text\",\n });\n};\n\n/**\n * Creates a Resource and calls fetchText() on it.\n *\n * @param {string|object} options A url or an object with the following properties\n * @param {string} options.url The url of the resource.\n * @param {object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\n * @param {object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\n * @param {object} [options.headers={}] Additional HTTP headers that will be sent.\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\n * @param {number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n */\nResource.fetchText = function (options) {\n const resource = new Resource(options);\n return resource.fetchText();\n};\n\n// note: */* below is */* but that ends the comment block early\n/**\n * Asynchronously loads the given resource as JSON. Returns a promise that will resolve to\n * a JSON object once loaded, or reject if the resource failed to load. The data is loaded\n * using XMLHttpRequest, which means that in order to make requests to another origin,\n * the server must have Cross-Origin Resource Sharing (CORS) headers enabled. This function\n * adds 'Accept: application/json,*/*;q=0.01' to the request headers, if not\n * already specified.\n *\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n *\n *\n * @example\n * resource.fetchJson().then(function(jsonData) {\n * // Do something with the JSON object\n * }).catch(function(error) {\n * // an error occurred\n * });\n *\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\n */\nResource.prototype.fetchJson = function () {\n const promise = this.fetch({\n responseType: \"text\",\n headers: {\n Accept: \"application/json,*/*;q=0.01\",\n },\n });\n\n if (!defined(promise)) {\n return undefined;\n }\n\n return promise.then(function (value) {\n if (!defined(value)) {\n return;\n }\n return JSON.parse(value);\n });\n};\n\n/**\n * Creates a Resource and calls fetchJson() on it.\n *\n * @param {string|object} options A url or an object with the following properties\n * @param {string} options.url The url of the resource.\n * @param {object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\n * @param {object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\n * @param {object} [options.headers={}] Additional HTTP headers that will be sent.\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\n * @param {number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n */\nResource.fetchJson = function (options) {\n const resource = new Resource(options);\n return resource.fetchJson();\n};\n\n/**\n * Asynchronously loads the given resource as XML. Returns a promise that will resolve to\n * an XML Document once loaded, or reject if the resource failed to load. The data is loaded\n * using XMLHttpRequest, which means that in order to make requests to another origin,\n * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.\n *\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n *\n *\n * @example\n * // load XML from a URL, setting a custom header\n * Cesium.loadXML('http://someUrl.com/someXML.xml', {\n * 'X-Custom-Header' : 'some value'\n * }).then(function(document) {\n * // Do something with the document\n * }).catch(function(error) {\n * // an error occurred\n * });\n *\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest|XMLHttpRequest}\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\n */\nResource.prototype.fetchXML = function () {\n return this.fetch({\n responseType: \"document\",\n overrideMimeType: \"text/xml\",\n });\n};\n\n/**\n * Creates a Resource and calls fetchXML() on it.\n *\n * @param {string|object} options A url or an object with the following properties\n * @param {string} options.url The url of the resource.\n * @param {object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\n * @param {object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\n * @param {object} [options.headers={}] Additional HTTP headers that will be sent.\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\n * @param {number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n */\nResource.fetchXML = function (options) {\n const resource = new Resource(options);\n return resource.fetchXML();\n};\n\n/**\n * Requests a resource using JSONP.\n *\n * @param {string} [callbackParameterName='callback'] The callback parameter name that the server expects.\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n *\n *\n * @example\n * // load a data asynchronously\n * resource.fetchJsonp().then(function(data) {\n * // use the loaded data\n * }).catch(function(error) {\n * // an error occurred\n * });\n *\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\n */\nResource.prototype.fetchJsonp = function (callbackParameterName) {\n callbackParameterName = defaultValue(callbackParameterName, \"callback\");\n\n checkAndResetRequest(this.request);\n\n //generate a unique function name\n let functionName;\n do {\n functionName = `loadJsonp${CesiumMath.nextRandomNumber()\n .toString()\n .substring(2, 8)}`;\n } while (defined(window[functionName]));\n\n return fetchJsonp(this, callbackParameterName, functionName);\n};\n\nfunction fetchJsonp(resource, callbackParameterName, functionName) {\n const callbackQuery = {};\n callbackQuery[callbackParameterName] = functionName;\n resource.setQueryParameters(callbackQuery);\n\n const request = resource.request;\n const url = resource.url;\n request.url = url;\n request.requestFunction = function () {\n const deferred = defer();\n\n //assign a function with that name in the global scope\n window[functionName] = function (data) {\n deferred.resolve(data);\n\n try {\n delete window[functionName];\n } catch (e) {\n window[functionName] = undefined;\n }\n };\n\n Resource._Implementations.loadAndExecuteScript(url, functionName, deferred);\n return deferred.promise;\n };\n\n const promise = RequestScheduler.request(request);\n if (!defined(promise)) {\n return;\n }\n\n return promise.catch(function (e) {\n if (request.state !== RequestState.FAILED) {\n return Promise.reject(e);\n }\n\n return resource.retryOnError(e).then(function (retry) {\n if (retry) {\n // Reset request so it can try again\n request.state = RequestState.UNISSUED;\n request.deferred = undefined;\n\n return fetchJsonp(resource, callbackParameterName, functionName);\n }\n\n return Promise.reject(e);\n });\n });\n}\n\n/**\n * Creates a Resource from a URL and calls fetchJsonp() on it.\n *\n * @param {string|object} options A url or an object with the following properties\n * @param {string} options.url The url of the resource.\n * @param {object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\n * @param {object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\n * @param {object} [options.headers={}] Additional HTTP headers that will be sent.\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\n * @param {number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\n * @param {string} [options.callbackParameterName='callback'] The callback parameter name that the server expects.\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n */\nResource.fetchJsonp = function (options) {\n const resource = new Resource(options);\n return resource.fetchJsonp(options.callbackParameterName);\n};\n\n/**\n * @private\n */\nResource.prototype._makeRequest = function (options) {\n const resource = this;\n checkAndResetRequest(resource.request);\n\n const request = resource.request;\n const url = resource.url;\n request.url = url;\n\n request.requestFunction = function () {\n const responseType = options.responseType;\n const headers = combine(options.headers, resource.headers);\n const overrideMimeType = options.overrideMimeType;\n const method = options.method;\n const data = options.data;\n const deferred = defer();\n const xhr = Resource._Implementations.loadWithXhr(\n url,\n responseType,\n method,\n data,\n headers,\n deferred,\n overrideMimeType,\n );\n if (defined(xhr) && defined(xhr.abort)) {\n request.cancelFunction = function () {\n xhr.abort();\n };\n }\n return deferred.promise;\n };\n\n const promise = RequestScheduler.request(request);\n if (!defined(promise)) {\n return;\n }\n\n return promise\n .then(function (data) {\n // explicitly set to undefined to ensure GC of request response data. See #8843\n request.cancelFunction = undefined;\n return data;\n })\n .catch(function (e) {\n request.cancelFunction = undefined;\n if (request.state !== RequestState.FAILED) {\n return Promise.reject(e);\n }\n\n return resource.retryOnError(e).then(function (retry) {\n if (retry) {\n // Reset request so it can try again\n request.state = RequestState.UNISSUED;\n request.deferred = undefined;\n\n return resource.fetch(options);\n }\n\n return Promise.reject(e);\n });\n });\n};\n\n/**\n * Checks to make sure the Resource isn't already being requested.\n *\n * @param {Request} request The request to check.\n *\n * @private\n */\nfunction checkAndResetRequest(request) {\n if (\n request.state === RequestState.ISSUED ||\n request.state === RequestState.ACTIVE\n ) {\n throw new RuntimeError(\"The Resource is already being fetched.\");\n }\n\n request.state = RequestState.UNISSUED;\n request.deferred = undefined;\n}\n\nconst dataUriRegex = /^data:(.*?)(;base64)?,(.*)$/;\n\nfunction decodeDataUriText(isBase64, data) {\n const result = decodeURIComponent(data);\n if (isBase64) {\n return atob(result);\n }\n return result;\n}\n\nfunction decodeDataUriArrayBuffer(isBase64, data) {\n const byteString = decodeDataUriText(isBase64, data);\n const buffer = new ArrayBuffer(byteString.length);\n const view = new Uint8Array(buffer);\n for (let i = 0; i < byteString.length; i++) {\n view[i] = byteString.charCodeAt(i);\n }\n return buffer;\n}\n\nfunction decodeDataUri(dataUriRegexResult, responseType) {\n responseType = defaultValue(responseType, \"\");\n const mimeType = dataUriRegexResult[1];\n const isBase64 = !!dataUriRegexResult[2];\n const data = dataUriRegexResult[3];\n let buffer;\n let parser;\n\n switch (responseType) {\n case \"\":\n case \"text\":\n return decodeDataUriText(isBase64, data);\n case \"arraybuffer\":\n return decodeDataUriArrayBuffer(isBase64, data);\n case \"blob\":\n buffer = decodeDataUriArrayBuffer(isBase64, data);\n return new Blob([buffer], {\n type: mimeType,\n });\n case \"document\":\n parser = new DOMParser();\n return parser.parseFromString(\n decodeDataUriText(isBase64, data),\n mimeType,\n );\n case \"json\":\n return JSON.parse(decodeDataUriText(isBase64, data));\n default:\n //>>includeStart('debug', pragmas.debug);\n throw new DeveloperError(`Unhandled responseType: ${responseType}`);\n //>>includeEnd('debug');\n }\n}\n\n/**\n * Asynchronously loads the given resource. Returns a promise that will resolve to\n * the result once loaded, or reject if the resource failed to load. The data is loaded\n * using XMLHttpRequest, which means that in order to make requests to another origin,\n * the server must have Cross-Origin Resource Sharing (CORS) headers enabled. It's recommended that you use\n * the more specific functions eg. fetchJson, fetchBlob, etc.\n *\n * @param {object} [options] Object with the following properties:\n * @param {string} [options.responseType] The type of response. This controls the type of item returned.\n * @param {object} [options.headers] Additional HTTP headers to send with the request, if any.\n * @param {string} [options.overrideMimeType] Overrides the MIME type returned by the server.\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n *\n *\n * @example\n * resource.fetch()\n * .then(function(body) {\n * // use the data\n * }).catch(function(error) {\n * // an error occurred\n * });\n *\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\n */\nResource.prototype.fetch = function (options) {\n options = defaultClone(options, {});\n options.method = \"GET\";\n\n return this._makeRequest(options);\n};\n\n/**\n * Creates a Resource from a URL and calls fetch() on it.\n *\n * @param {string|object} options A url or an object with the following properties\n * @param {string} options.url The url of the resource.\n * @param {object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\n * @param {object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\n * @param {object} [options.headers={}] Additional HTTP headers that will be sent.\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\n * @param {number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\n * @param {string} [options.responseType] The type of response. This controls the type of item returned.\n * @param {string} [options.overrideMimeType] Overrides the MIME type returned by the server.\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n */\nResource.fetch = function (options) {\n const resource = new Resource(options);\n return resource.fetch({\n // Make copy of just the needed fields because headers can be passed to both the constructor and to fetch\n responseType: options.responseType,\n overrideMimeType: options.overrideMimeType,\n });\n};\n\n/**\n * Asynchronously deletes the given resource. Returns a promise that will resolve to\n * the result once loaded, or reject if the resource failed to load. The data is loaded\n * using XMLHttpRequest, which means that in order to make requests to another origin,\n * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.\n *\n * @param {object} [options] Object with the following properties:\n * @param {string} [options.responseType] The type of response. This controls the type of item returned.\n * @param {object} [options.headers] Additional HTTP headers to send with the request, if any.\n * @param {string} [options.overrideMimeType] Overrides the MIME type returned by the server.\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n *\n *\n * @example\n * resource.delete()\n * .then(function(body) {\n * // use the data\n * }).catch(function(error) {\n * // an error occurred\n * });\n *\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\n */\nResource.prototype.delete = function (options) {\n options = defaultClone(options, {});\n options.method = \"DELETE\";\n\n return this._makeRequest(options);\n};\n\n/**\n * Creates a Resource from a URL and calls delete() on it.\n *\n * @param {string|object} options A url or an object with the following properties\n * @param {string} options.url The url of the resource.\n * @param {object} [options.data] Data that is posted with the resource.\n * @param {object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\n * @param {object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\n * @param {object} [options.headers={}] Additional HTTP headers that will be sent.\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\n * @param {number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\n * @param {string} [options.responseType] The type of response. This controls the type of item returned.\n * @param {string} [options.overrideMimeType] Overrides the MIME type returned by the server.\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n */\nResource.delete = function (options) {\n const resource = new Resource(options);\n return resource.delete({\n // Make copy of just the needed fields because headers can be passed to both the constructor and to fetch\n responseType: options.responseType,\n overrideMimeType: options.overrideMimeType,\n data: options.data,\n });\n};\n\n/**\n * Asynchronously gets headers the given resource. Returns a promise that will resolve to\n * the result once loaded, or reject if the resource failed to load. The data is loaded\n * using XMLHttpRequest, which means that in order to make requests to another origin,\n * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.\n *\n * @param {object} [options] Object with the following properties:\n * @param {string} [options.responseType] The type of response. This controls the type of item returned.\n * @param {object} [options.headers] Additional HTTP headers to send with the request, if any.\n * @param {string} [options.overrideMimeType] Overrides the MIME type returned by the server.\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n *\n *\n * @example\n * resource.head()\n * .then(function(headers) {\n * // use the data\n * }).catch(function(error) {\n * // an error occurred\n * });\n *\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\n */\nResource.prototype.head = function (options) {\n options = defaultClone(options, {});\n options.method = \"HEAD\";\n\n return this._makeRequest(options);\n};\n\n/**\n * Creates a Resource from a URL and calls head() on it.\n *\n * @param {string|object} options A url or an object with the following properties\n * @param {string} options.url The url of the resource.\n * @param {object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\n * @param {object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\n * @param {object} [options.headers={}] Additional HTTP headers that will be sent.\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\n * @param {number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\n * @param {string} [options.responseType] The type of response. This controls the type of item returned.\n * @param {string} [options.overrideMimeType] Overrides the MIME type returned by the server.\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n */\nResource.head = function (options) {\n const resource = new Resource(options);\n return resource.head({\n // Make copy of just the needed fields because headers can be passed to both the constructor and to fetch\n responseType: options.responseType,\n overrideMimeType: options.overrideMimeType,\n });\n};\n\n/**\n * Asynchronously gets options the given resource. Returns a promise that will resolve to\n * the result once loaded, or reject if the resource failed to load. The data is loaded\n * using XMLHttpRequest, which means that in order to make requests to another origin,\n * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.\n *\n * @param {object} [options] Object with the following properties:\n * @param {string} [options.responseType] The type of response. This controls the type of item returned.\n * @param {object} [options.headers] Additional HTTP headers to send with the request, if any.\n * @param {string} [options.overrideMimeType] Overrides the MIME type returned by the server.\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n *\n *\n * @example\n * resource.options()\n * .then(function(headers) {\n * // use the data\n * }).catch(function(error) {\n * // an error occurred\n * });\n *\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\n */\nResource.prototype.options = function (options) {\n options = defaultClone(options, {});\n options.method = \"OPTIONS\";\n\n return this._makeRequest(options);\n};\n\n/**\n * Creates a Resource from a URL and calls options() on it.\n *\n * @param {string|object} options A url or an object with the following properties\n * @param {string} options.url The url of the resource.\n * @param {object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\n * @param {object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\n * @param {object} [options.headers={}] Additional HTTP headers that will be sent.\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\n * @param {number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\n * @param {string} [options.responseType] The type of response. This controls the type of item returned.\n * @param {string} [options.overrideMimeType] Overrides the MIME type returned by the server.\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n */\nResource.options = function (options) {\n const resource = new Resource(options);\n return resource.options({\n // Make copy of just the needed fields because headers can be passed to both the constructor and to fetch\n responseType: options.responseType,\n overrideMimeType: options.overrideMimeType,\n });\n};\n\n/**\n * Asynchronously posts data to the given resource. Returns a promise that will resolve to\n * the result once loaded, or reject if the resource failed to load. The data is loaded\n * using XMLHttpRequest, which means that in order to make requests to another origin,\n * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.\n *\n * @param {object} data Data that is posted with the resource.\n * @param {object} [options] Object with the following properties:\n * @param {object} [options.data] Data that is posted with the resource.\n * @param {string} [options.responseType] The type of response. This controls the type of item returned.\n * @param {object} [options.headers] Additional HTTP headers to send with the request, if any.\n * @param {string} [options.overrideMimeType] Overrides the MIME type returned by the server.\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n *\n *\n * @example\n * resource.post(data)\n * .then(function(result) {\n * // use the result\n * }).catch(function(error) {\n * // an error occurred\n * });\n *\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\n */\nResource.prototype.post = function (data, options) {\n Check.defined(\"data\", data);\n\n options = defaultClone(options, {});\n options.method = \"POST\";\n options.data = data;\n\n return this._makeRequest(options);\n};\n\n/**\n * Creates a Resource from a URL and calls post() on it.\n *\n * @param {object} options A url or an object with the following properties\n * @param {string} options.url The url of the resource.\n * @param {object} options.data Data that is posted with the resource.\n * @param {object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\n * @param {object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\n * @param {object} [options.headers={}] Additional HTTP headers that will be sent.\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\n * @param {number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\n * @param {string} [options.responseType] The type of response. This controls the type of item returned.\n * @param {string} [options.overrideMimeType] Overrides the MIME type returned by the server.\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n */\nResource.post = function (options) {\n const resource = new Resource(options);\n return resource.post(options.data, {\n // Make copy of just the needed fields because headers can be passed to both the constructor and to post\n responseType: options.responseType,\n overrideMimeType: options.overrideMimeType,\n });\n};\n\n/**\n * Asynchronously puts data to the given resource. Returns a promise that will resolve to\n * the result once loaded, or reject if the resource failed to load. The data is loaded\n * using XMLHttpRequest, which means that in order to make requests to another origin,\n * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.\n *\n * @param {object} data Data that is posted with the resource.\n * @param {object} [options] Object with the following properties:\n * @param {string} [options.responseType] The type of response. This controls the type of item returned.\n * @param {object} [options.headers] Additional HTTP headers to send with the request, if any.\n * @param {string} [options.overrideMimeType] Overrides the MIME type returned by the server.\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n *\n *\n * @example\n * resource.put(data)\n * .then(function(result) {\n * // use the result\n * }).catch(function(error) {\n * // an error occurred\n * });\n *\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\n */\nResource.prototype.put = function (data, options) {\n Check.defined(\"data\", data);\n\n options = defaultClone(options, {});\n options.method = \"PUT\";\n options.data = data;\n\n return this._makeRequest(options);\n};\n\n/**\n * Creates a Resource from a URL and calls put() on it.\n *\n * @param {object} options A url or an object with the following properties\n * @param {string} options.url The url of the resource.\n * @param {object} options.data Data that is posted with the resource.\n * @param {object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\n * @param {object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\n * @param {object} [options.headers={}] Additional HTTP headers that will be sent.\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\n * @param {number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\n * @param {string} [options.responseType] The type of response. This controls the type of item returned.\n * @param {string} [options.overrideMimeType] Overrides the MIME type returned by the server.\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n */\nResource.put = function (options) {\n const resource = new Resource(options);\n return resource.put(options.data, {\n // Make copy of just the needed fields because headers can be passed to both the constructor and to post\n responseType: options.responseType,\n overrideMimeType: options.overrideMimeType,\n });\n};\n\n/**\n * Asynchronously patches data to the given resource. Returns a promise that will resolve to\n * the result once loaded, or reject if the resource failed to load. The data is loaded\n * using XMLHttpRequest, which means that in order to make requests to another origin,\n * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.\n *\n * @param {object} data Data that is posted with the resource.\n * @param {object} [options] Object with the following properties:\n * @param {string} [options.responseType] The type of response. This controls the type of item returned.\n * @param {object} [options.headers] Additional HTTP headers to send with the request, if any.\n * @param {string} [options.overrideMimeType] Overrides the MIME type returned by the server.\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n *\n *\n * @example\n * resource.patch(data)\n * .then(function(result) {\n * // use the result\n * }).catch(function(error) {\n * // an error occurred\n * });\n *\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\n */\nResource.prototype.patch = function (data, options) {\n Check.defined(\"data\", data);\n\n options = defaultClone(options, {});\n options.method = \"PATCH\";\n options.data = data;\n\n return this._makeRequest(options);\n};\n\n/**\n * Creates a Resource from a URL and calls patch() on it.\n *\n * @param {object} options A url or an object with the following properties\n * @param {string} options.url The url of the resource.\n * @param {object} options.data Data that is posted with the resource.\n * @param {object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\n * @param {object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\n * @param {object} [options.headers={}] Additional HTTP headers that will be sent.\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\n * @param {number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\n * @param {string} [options.responseType] The type of response. This controls the type of item returned.\n * @param {string} [options.overrideMimeType] Overrides the MIME type returned by the server.\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n */\nResource.patch = function (options) {\n const resource = new Resource(options);\n return resource.patch(options.data, {\n // Make copy of just the needed fields because headers can be passed to both the constructor and to post\n responseType: options.responseType,\n overrideMimeType: options.overrideMimeType,\n });\n};\n\n/**\n * Contains implementations of functions that can be replaced for testing\n *\n * @private\n */\nResource._Implementations = {};\n\nResource._Implementations.loadImageElement = function (\n url,\n crossOrigin,\n deferred,\n) {\n const image = new Image();\n\n image.onload = function () {\n // work-around a known issue with Firefox and dimensionless SVG, see:\n // - https://github.com/whatwg/html/issues/3510\n // - https://bugzilla.mozilla.org/show_bug.cgi?id=700533\n if (\n image.naturalWidth === 0 &&\n image.naturalHeight === 0 &&\n image.width === 0 &&\n image.height === 0\n ) {\n // these values affect rasterization and will likely mar the content\n // until Firefox takes a stance on the issue, marred content is better than no content\n // Chromium uses a more refined heuristic about its choice given nil viewBox, and a better stance and solution is\n // proposed later in the original issue thread:\n // - Chromium behavior: https://github.com/CesiumGS/cesium/issues/9188#issuecomment-704400825\n // - Cesium's stance/solve: https://github.com/CesiumGS/cesium/issues/9188#issuecomment-720645777\n image.width = 300;\n image.height = 150;\n }\n deferred.resolve(image);\n };\n\n image.onerror = function (e) {\n deferred.reject(e);\n };\n\n if (crossOrigin) {\n if (TrustedServers.contains(url)) {\n image.crossOrigin = \"use-credentials\";\n } else {\n image.crossOrigin = \"\";\n }\n }\n\n image.src = url;\n};\n\nResource._Implementations.createImage = function (\n request,\n crossOrigin,\n deferred,\n flipY,\n skipColorSpaceConversion,\n preferImageBitmap,\n) {\n const url = request.url;\n // Passing an Image to createImageBitmap will force it to run on the main thread\n // since DOM elements don't exist on workers. We convert it to a blob so it's non-blocking.\n // See:\n // https://bugzilla.mozilla.org/show_bug.cgi?id=1044102#c38\n // https://bugs.chromium.org/p/chromium/issues/detail?id=580202#c10\n Resource.supportsImageBitmapOptions()\n .then(function (supportsImageBitmap) {\n // We can only use ImageBitmap if we can flip on decode.\n // See: https://github.com/CesiumGS/cesium/pull/7579#issuecomment-466146898\n if (!(supportsImageBitmap && preferImageBitmap)) {\n Resource._Implementations.loadImageElement(url, crossOrigin, deferred);\n return;\n }\n const responseType = \"blob\";\n const method = \"GET\";\n const xhrDeferred = defer();\n const xhr = Resource._Implementations.loadWithXhr(\n url,\n responseType,\n method,\n undefined,\n undefined,\n xhrDeferred,\n undefined,\n undefined,\n undefined,\n );\n\n if (defined(xhr) && defined(xhr.abort)) {\n request.cancelFunction = function () {\n xhr.abort();\n };\n }\n return xhrDeferred.promise\n .then(function (blob) {\n if (!defined(blob)) {\n deferred.reject(\n new RuntimeError(\n `Successfully retrieved ${url} but it contained no content.`,\n ),\n );\n return;\n }\n\n return Resource.createImageBitmapFromBlob(blob, {\n flipY: flipY,\n premultiplyAlpha: false,\n skipColorSpaceConversion: skipColorSpaceConversion,\n });\n })\n .then(function (image) {\n deferred.resolve(image);\n });\n })\n .catch(function (e) {\n deferred.reject(e);\n });\n};\n\n/**\n * Wrapper for createImageBitmap\n *\n * @private\n */\nResource.createImageBitmapFromBlob = function (blob, options) {\n Check.defined(\"options\", options);\n Check.typeOf.bool(\"options.flipY\", options.flipY);\n Check.typeOf.bool(\"options.premultiplyAlpha\", options.premultiplyAlpha);\n Check.typeOf.bool(\n \"options.skipColorSpaceConversion\",\n options.skipColorSpaceConversion,\n );\n\n return createImageBitmap(blob, {\n imageOrientation: options.flipY ? \"flipY\" : \"none\",\n premultiplyAlpha: options.premultiplyAlpha ? \"premultiply\" : \"none\",\n colorSpaceConversion: options.skipColorSpaceConversion ? \"none\" : \"default\",\n });\n};\n\nfunction loadWithHttpRequest(\n url,\n responseType,\n method,\n data,\n headers,\n deferred,\n overrideMimeType,\n) {\n // Note: only the 'json' and 'text' responseTypes transforms the loaded buffer\n fetch(url, {\n method,\n headers,\n })\n .then(async (response) => {\n if (!response.ok) {\n const responseHeaders = {};\n response.headers.forEach((value, key) => {\n responseHeaders[key] = value;\n });\n deferred.reject(\n new RequestErrorEvent(response.status, response, responseHeaders),\n );\n return;\n }\n\n switch (responseType) {\n case \"text\":\n deferred.resolve(response.text());\n break;\n case \"json\":\n deferred.resolve(response.json());\n break;\n default:\n deferred.resolve(new Uint8Array(await response.arrayBuffer()).buffer);\n break;\n }\n })\n .catch(() => {\n deferred.reject(new RequestErrorEvent());\n });\n}\n\nconst noXMLHttpRequest = typeof XMLHttpRequest === \"undefined\";\nResource._Implementations.loadWithXhr = function (\n url,\n responseType,\n method,\n data,\n headers,\n deferred,\n overrideMimeType,\n) {\n const dataUriRegexResult = dataUriRegex.exec(url);\n if (dataUriRegexResult !== null) {\n deferred.resolve(decodeDataUri(dataUriRegexResult, responseType));\n return;\n }\n\n if (noXMLHttpRequest) {\n loadWithHttpRequest(\n url,\n responseType,\n method,\n data,\n headers,\n deferred,\n overrideMimeType,\n );\n return;\n }\n\n const xhr = new XMLHttpRequest();\n\n if (TrustedServers.contains(url)) {\n xhr.withCredentials = true;\n }\n\n xhr.open(method, url, true);\n\n if (defined(overrideMimeType) && defined(xhr.overrideMimeType)) {\n xhr.overrideMimeType(overrideMimeType);\n }\n\n if (defined(headers)) {\n for (const key in headers) {\n if (headers.hasOwnProperty(key)) {\n xhr.setRequestHeader(key, headers[key]);\n }\n }\n }\n\n if (defined(responseType)) {\n xhr.responseType = responseType;\n }\n\n // While non-standard, file protocol always returns a status of 0 on success\n let localFile = false;\n if (typeof url === \"string\") {\n localFile =\n url.indexOf(\"file://\") === 0 ||\n (typeof window !== \"undefined\" && window.location.origin === \"file://\");\n }\n\n xhr.onload = function () {\n if (\n (xhr.status < 200 || xhr.status >= 300) &&\n !(localFile && xhr.status === 0)\n ) {\n deferred.reject(\n new RequestErrorEvent(\n xhr.status,\n xhr.response,\n xhr.getAllResponseHeaders(),\n ),\n );\n return;\n }\n\n const response = xhr.response;\n const browserResponseType = xhr.responseType;\n\n if (method === \"HEAD\" || method === \"OPTIONS\") {\n const responseHeaderString = xhr.getAllResponseHeaders();\n const splitHeaders = responseHeaderString.trim().split(/[\\r\\n]+/);\n\n const responseHeaders = {};\n splitHeaders.forEach(function (line) {\n const parts = line.split(\": \");\n const header = parts.shift();\n responseHeaders[header] = parts.join(\": \");\n });\n\n deferred.resolve(responseHeaders);\n return;\n }\n\n //All modern browsers will go into either the first or second if block or last else block.\n //Other code paths support older browsers that either do not support the supplied responseType\n //or do not support the xhr.response property.\n if (xhr.status === 204) {\n // accept no content\n deferred.resolve(undefined);\n } else if (\n defined(response) &&\n (!defined(responseType) || browserResponseType === responseType)\n ) {\n deferred.resolve(response);\n } else if (responseType === \"json\" && typeof response === \"string\") {\n try {\n deferred.resolve(JSON.parse(response));\n } catch (e) {\n deferred.reject(e);\n }\n } else if (\n (browserResponseType === \"\" || browserResponseType === \"document\") &&\n defined(xhr.responseXML) &&\n xhr.responseXML.hasChildNodes()\n ) {\n deferred.resolve(xhr.responseXML);\n } else if (\n (browserResponseType === \"\" || browserResponseType === \"text\") &&\n defined(xhr.responseText)\n ) {\n deferred.resolve(xhr.responseText);\n } else {\n deferred.reject(\n new RuntimeError(\"Invalid XMLHttpRequest response type.\"),\n );\n }\n };\n\n xhr.onerror = function (e) {\n deferred.reject(new RequestErrorEvent());\n };\n\n xhr.send(data);\n\n return xhr;\n};\n\nResource._Implementations.loadAndExecuteScript = function (\n url,\n functionName,\n deferred,\n) {\n return loadAndExecuteScript(url, functionName).catch(function (e) {\n deferred.reject(e);\n });\n};\n\n/**\n * The default implementations\n *\n * @private\n */\nResource._DefaultImplementations = {};\nResource._DefaultImplementations.createImage =\n Resource._Implementations.createImage;\nResource._DefaultImplementations.loadWithXhr =\n Resource._Implementations.loadWithXhr;\nResource._DefaultImplementations.loadAndExecuteScript =\n Resource._Implementations.loadAndExecuteScript;\n\n/**\n * A resource instance initialized to the current browser location\n *\n * @type {Resource}\n * @constant\n */\nResource.DEFAULT = Object.freeze(\n new Resource({\n url:\n typeof document === \"undefined\"\n ? \"\"\n : document.location.href.split(\"?\")[0],\n }),\n);\n\n/**\n * A function that returns the value of the property.\n * @callback Resource.RetryCallback\n *\n * @param {Resource} [resource] The resource that failed to load.\n * @param {RequestErrorEvent} [error] The error that occurred during the loading of the resource.\n * @returns {boolean|Promisetrue
is preferable for requests going through HTTP/1 servers.\n *\n * @type {boolean}\n * @readonly\n *\n * @default false\n */\n this.throttleByServer = throttleByServer;\n\n /**\n * Type of request.\n *\n * @type {RequestType}\n * @readonly\n *\n * @default RequestType.OTHER\n */\n this.type = defaultValue(options.type, RequestType.OTHER);\n\n /**\n * A key used to identify the server that a request is going to. It is derived from the url's authority and scheme.\n *\n * @type {string}\n *\n * @private\n */\n this.serverKey = options.serverKey;\n\n /**\n * The current state of the request.\n *\n * @type {RequestState}\n * @readonly\n */\n this.state = RequestState.UNISSUED;\n\n /**\n * The requests's deferred promise.\n *\n * @type {object}\n *\n * @private\n */\n this.deferred = undefined;\n\n /**\n * Whether the request was explicitly cancelled.\n *\n * @type {boolean}\n *\n * @private\n */\n this.cancelled = false;\n}\n\n/**\n * Mark the request as cancelled.\n *\n * @private\n */\nRequest.prototype.cancel = function () {\n this.cancelled = true;\n};\n\n/**\n * Duplicates a Request instance.\n *\n * @param {Request} [result] The object onto which to store the result.\n *\n * @returns {Request} The modified result parameter or a new Resource instance if one was not provided.\n */\nRequest.prototype.clone = function (result) {\n if (!defined(result)) {\n return new Request(this);\n }\n\n result.url = this.url;\n result.requestFunction = this.requestFunction;\n result.cancelFunction = this.cancelFunction;\n result.priorityFunction = this.priorityFunction;\n result.priority = this.priority;\n result.throttle = this.throttle;\n result.throttleByServer = this.throttleByServer;\n result.type = this.type;\n result.serverKey = this.serverKey;\n\n // These get defaulted because the cloned request hasn't been issued\n result.state = RequestState.UNISSUED;\n result.deferred = undefined;\n result.cancelled = false;\n\n return result;\n};\n\n/**\n * The function that makes the actual data request.\n * @callback Request.RequestCallback\n * @returns {PromisemaximumRequestsPerServer
.\n * Useful when streaming data from a known HTTP/2 or HTTP/3 server.\n * @type {object}\n *\n * @example\n * RequestScheduler.requestsByServer[\"myserver.com:443\"] = 18;\n *\n * @example\n * RequestScheduler.requestsByServer = {\n * \"api.cesium.com:443\": 18,\n * \"assets.cesium.com:443\": 18,\n * };\n */\nRequestScheduler.requestsByServer = {};\n\n/**\n * Specifies if the request scheduler should throttle incoming requests, or let the browser queue requests under its control.\n * @type {boolean}\n * @default true\n */\nRequestScheduler.throttleRequests = true;\n\n/**\n * When true, log statistics to the console every frame\n * @type {boolean}\n * @default false\n * @private\n */\nRequestScheduler.debugShowStatistics = false;\n\n/**\n * An event that's raised when a request is completed. Event handlers are passed\n * the error object if the request fails.\n *\n * @type {Event}\n * @default Event()\n * @private\n */\nRequestScheduler.requestCompletedEvent = requestCompletedEvent;\n\nObject.defineProperties(RequestScheduler, {\n /**\n * Returns the statistics used by the request scheduler.\n *\n * @memberof RequestScheduler\n *\n * @type {object}\n * @readonly\n * @private\n */\n statistics: {\n get: function () {\n return statistics;\n },\n },\n\n /**\n * The maximum size of the priority heap. This limits the number of requests that are sorted by priority. Only applies to requests that are not yet active.\n *\n * @memberof RequestScheduler\n *\n * @type {number}\n * @default 20\n * @private\n */\n priorityHeapLength: {\n get: function () {\n return priorityHeapLength;\n },\n set: function (value) {\n // If the new length shrinks the heap, need to cancel some of the requests.\n // Since this value is not intended to be tweaked regularly it is fine to just cancel the high priority requests.\n if (value < priorityHeapLength) {\n while (requestHeap.length > value) {\n const request = requestHeap.pop();\n cancelRequest(request);\n }\n }\n priorityHeapLength = value;\n requestHeap.maximumLength = value;\n requestHeap.reserve(value);\n },\n },\n});\n\nfunction updatePriority(request) {\n if (defined(request.priorityFunction)) {\n request.priority = request.priorityFunction();\n }\n}\n\n/**\n * Check if there are open slots for a particular server key. If desiredRequests is greater than 1, this checks if the queue has room for scheduling multiple requests.\n * @param {string} serverKey The server key returned by {@link RequestScheduler.getServerKey}.\n * @param {number} [desiredRequests=1] How many requests the caller plans to request\n * @return {boolean} True if there are enough open slots for desiredRequests
more requests.\n * @private\n */\nRequestScheduler.serverHasOpenSlots = function (serverKey, desiredRequests) {\n desiredRequests = defaultValue(desiredRequests, 1);\n\n const maxRequests = defaultValue(\n RequestScheduler.requestsByServer[serverKey],\n RequestScheduler.maximumRequestsPerServer,\n );\n const hasOpenSlotsServer =\n numberOfActiveRequestsByServer[serverKey] + desiredRequests <= maxRequests;\n\n return hasOpenSlotsServer;\n};\n\n/**\n * Check if the priority heap has open slots, regardless of which server they\n * are from. This is used in {@link Multiple3DTileContent} for determining when\n * all requests can be scheduled\n * @param {number} desiredRequests The number of requests the caller intends to make\n * @return {boolean} true
if the heap has enough available slots to meet the desiredRequests. false
otherwise.\n *\n * @private\n */\nRequestScheduler.heapHasOpenSlots = function (desiredRequests) {\n const hasOpenSlotsHeap =\n requestHeap.length + desiredRequests <= priorityHeapLength;\n return hasOpenSlotsHeap;\n};\n\nfunction issueRequest(request) {\n if (request.state === RequestState.UNISSUED) {\n request.state = RequestState.ISSUED;\n request.deferred = defer();\n }\n return request.deferred.promise;\n}\n\nfunction getRequestReceivedFunction(request) {\n return function (results) {\n if (request.state === RequestState.CANCELLED) {\n // If the data request comes back but the request is cancelled, ignore it.\n return;\n }\n // explicitly set to undefined to ensure GC of request response data. See #8843\n const deferred = request.deferred;\n\n --statistics.numberOfActiveRequests;\n --numberOfActiveRequestsByServer[request.serverKey];\n requestCompletedEvent.raiseEvent();\n request.state = RequestState.RECEIVED;\n request.deferred = undefined;\n\n deferred.resolve(results);\n };\n}\n\nfunction getRequestFailedFunction(request) {\n return function (error) {\n if (request.state === RequestState.CANCELLED) {\n // If the data request comes back but the request is cancelled, ignore it.\n return;\n }\n ++statistics.numberOfFailedRequests;\n --statistics.numberOfActiveRequests;\n --numberOfActiveRequestsByServer[request.serverKey];\n requestCompletedEvent.raiseEvent(error);\n request.state = RequestState.FAILED;\n request.deferred.reject(error);\n };\n}\n\nfunction startRequest(request) {\n const promise = issueRequest(request);\n request.state = RequestState.ACTIVE;\n activeRequests.push(request);\n ++statistics.numberOfActiveRequests;\n ++statistics.numberOfActiveRequestsEver;\n ++numberOfActiveRequestsByServer[request.serverKey];\n request\n .requestFunction()\n .then(getRequestReceivedFunction(request))\n .catch(getRequestFailedFunction(request));\n return promise;\n}\n\nfunction cancelRequest(request) {\n const active = request.state === RequestState.ACTIVE;\n request.state = RequestState.CANCELLED;\n ++statistics.numberOfCancelledRequests;\n // check that deferred has not been cleared since cancelRequest can be called\n // on a finished request, e.g. by clearForSpecs during tests\n if (defined(request.deferred)) {\n const deferred = request.deferred;\n request.deferred = undefined;\n deferred.reject();\n }\n\n if (active) {\n --statistics.numberOfActiveRequests;\n --numberOfActiveRequestsByServer[request.serverKey];\n ++statistics.numberOfCancelledActiveRequests;\n }\n\n if (defined(request.cancelFunction)) {\n request.cancelFunction();\n }\n}\n\n/**\n * Sort requests by priority and start requests.\n * @private\n */\nRequestScheduler.update = function () {\n let i;\n let request;\n\n // Loop over all active requests. Cancelled, failed, or received requests are removed from the array to make room for new requests.\n let removeCount = 0;\n const activeLength = activeRequests.length;\n for (i = 0; i < activeLength; ++i) {\n request = activeRequests[i];\n if (request.cancelled) {\n // Request was explicitly cancelled\n cancelRequest(request);\n }\n if (request.state !== RequestState.ACTIVE) {\n // Request is no longer active, remove from array\n ++removeCount;\n continue;\n }\n if (removeCount > 0) {\n // Shift back to fill in vacated slots from completed requests\n activeRequests[i - removeCount] = request;\n }\n }\n activeRequests.length -= removeCount;\n\n // Update priority of issued requests and resort the heap\n const issuedRequests = requestHeap.internalArray;\n const issuedLength = requestHeap.length;\n for (i = 0; i < issuedLength; ++i) {\n updatePriority(issuedRequests[i]);\n }\n requestHeap.resort();\n\n // Get the number of open slots and fill with the highest priority requests.\n // Un-throttled requests are automatically added to activeRequests, so activeRequests.length may exceed maximumRequests\n const openSlots = Math.max(\n RequestScheduler.maximumRequests - activeRequests.length,\n 0,\n );\n let filledSlots = 0;\n while (filledSlots < openSlots && requestHeap.length > 0) {\n // Loop until all open slots are filled or the heap becomes empty\n request = requestHeap.pop();\n if (request.cancelled) {\n // Request was explicitly cancelled\n cancelRequest(request);\n continue;\n }\n\n if (\n request.throttleByServer &&\n !RequestScheduler.serverHasOpenSlots(request.serverKey)\n ) {\n // Open slots are available, but the request is throttled by its server. Cancel and try again later.\n cancelRequest(request);\n continue;\n }\n\n startRequest(request);\n ++filledSlots;\n }\n\n updateStatistics();\n};\n\n/**\n * Get the server key from a given url.\n *\n * @param {string} url The url.\n * @returns {string} The server key.\n * @private\n */\nRequestScheduler.getServerKey = function (url) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.string(\"url\", url);\n //>>includeEnd('debug');\n\n let uri = new Uri(url);\n if (uri.scheme() === \"\") {\n uri = uri.absoluteTo(pageUri);\n uri.normalize();\n }\n\n let serverKey = uri.authority();\n if (!/:/.test(serverKey)) {\n // If the authority does not contain a port number, add port 443 for https or port 80 for http\n serverKey = `${serverKey}:${uri.scheme() === \"https\" ? \"443\" : \"80\"}`;\n }\n\n const length = numberOfActiveRequestsByServer[serverKey];\n if (!defined(length)) {\n numberOfActiveRequestsByServer[serverKey] = 0;\n }\n\n return serverKey;\n};\n\n/**\n * Issue a request. If request.throttle is false, the request is sent immediately. Otherwise the request will be\n * queued and sorted by priority before being sent.\n *\n * @param {Request} request The request object.\n *\n * @returns {Promise|undefined} A Promise for the requested data, or undefined if this request does not have high enough priority to be issued.\n *\n * @private\n */\nRequestScheduler.request = function (request) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"request\", request);\n Check.typeOf.string(\"request.url\", request.url);\n Check.typeOf.func(\"request.requestFunction\", request.requestFunction);\n //>>includeEnd('debug');\n\n if (isDataUri(request.url) || isBlobUri(request.url)) {\n requestCompletedEvent.raiseEvent();\n request.state = RequestState.RECEIVED;\n return request.requestFunction();\n }\n\n ++statistics.numberOfAttemptedRequests;\n\n if (!defined(request.serverKey)) {\n request.serverKey = RequestScheduler.getServerKey(request.url);\n }\n\n if (\n RequestScheduler.throttleRequests &&\n request.throttleByServer &&\n !RequestScheduler.serverHasOpenSlots(request.serverKey)\n ) {\n // Server is saturated. Try again later.\n return undefined;\n }\n\n if (!RequestScheduler.throttleRequests || !request.throttle) {\n return startRequest(request);\n }\n\n if (activeRequests.length >= RequestScheduler.maximumRequests) {\n // Active requests are saturated. Try again later.\n return undefined;\n }\n\n // Insert into the priority heap and see if a request was bumped off. If this request is the lowest\n // priority it will be returned.\n updatePriority(request);\n const removedRequest = requestHeap.insert(request);\n\n if (defined(removedRequest)) {\n if (removedRequest === request) {\n // Request does not have high enough priority to be issued\n return undefined;\n }\n // A previously issued request has been bumped off the priority heap, so cancel it\n cancelRequest(removedRequest);\n }\n\n return issueRequest(request);\n};\n\nfunction updateStatistics() {\n if (!RequestScheduler.debugShowStatistics) {\n return;\n }\n\n if (\n statistics.numberOfActiveRequests === 0 &&\n statistics.lastNumberOfActiveRequests > 0\n ) {\n if (statistics.numberOfAttemptedRequests > 0) {\n console.log(\n `Number of attempted requests: ${statistics.numberOfAttemptedRequests}`,\n );\n statistics.numberOfAttemptedRequests = 0;\n }\n\n if (statistics.numberOfCancelledRequests > 0) {\n console.log(\n `Number of cancelled requests: ${statistics.numberOfCancelledRequests}`,\n );\n statistics.numberOfCancelledRequests = 0;\n }\n\n if (statistics.numberOfCancelledActiveRequests > 0) {\n console.log(\n `Number of cancelled active requests: ${statistics.numberOfCancelledActiveRequests}`,\n );\n statistics.numberOfCancelledActiveRequests = 0;\n }\n\n if (statistics.numberOfFailedRequests > 0) {\n console.log(\n `Number of failed requests: ${statistics.numberOfFailedRequests}`,\n );\n statistics.numberOfFailedRequests = 0;\n }\n }\n\n statistics.lastNumberOfActiveRequests = statistics.numberOfActiveRequests;\n}\n\n/**\n * For testing only. Clears any requests that may not have completed from previous tests.\n *\n * @private\n */\nRequestScheduler.clearForSpecs = function () {\n while (requestHeap.length > 0) {\n const request = requestHeap.pop();\n cancelRequest(request);\n }\n const length = activeRequests.length;\n for (let i = 0; i < length; ++i) {\n cancelRequest(activeRequests[i]);\n }\n activeRequests.length = 0;\n numberOfActiveRequestsByServer = {};\n\n // Clear stats\n statistics.numberOfAttemptedRequests = 0;\n statistics.numberOfActiveRequests = 0;\n statistics.numberOfCancelledRequests = 0;\n statistics.numberOfCancelledActiveRequests = 0;\n statistics.numberOfFailedRequests = 0;\n statistics.numberOfActiveRequestsEver = 0;\n statistics.lastNumberOfActiveRequests = 0;\n};\n\n/**\n * For testing only.\n *\n * @private\n */\nRequestScheduler.numberOfActiveRequestsByServer = function (serverKey) {\n return numberOfActiveRequestsByServer[serverKey];\n};\n\n/**\n * For testing only.\n *\n * @private\n */\nRequestScheduler.requestHeap = requestHeap;\nexport default RequestScheduler;\n","import Check from \"./Check.js\";\nimport defined from \"./defined.js\";\n\n/**\n * A generic utility class for managing subscribers for a particular event.\n * This class is usually instantiated inside of a container class and\n * exposed as a property for others to subscribe to.\n *\n * @alias Event\n * @template Listener extends (...args: any[]) => void = (...args: any[]) => void\n * @constructor\n * @example\n * MyObject.prototype.myListener = function(arg1, arg2) {\n * this.myArg1Copy = arg1;\n * this.myArg2Copy = arg2;\n * }\n *\n * const myObjectInstance = new MyObject();\n * const evt = new Cesium.Event();\n * evt.addEventListener(MyObject.prototype.myListener, myObjectInstance);\n * evt.raiseEvent('1', '2');\n * evt.removeEventListener(MyObject.prototype.myListener);\n */\nfunction Event() {\n this._listeners = [];\n this._scopes = [];\n this._toRemove = [];\n this._insideRaiseEvent = false;\n}\n\nObject.defineProperties(Event.prototype, {\n /**\n * The number of listeners currently subscribed to the event.\n * @memberof Event.prototype\n * @type {number}\n * @readonly\n */\n numberOfListeners: {\n get: function () {\n return this._listeners.length - this._toRemove.length;\n },\n },\n});\n\n/**\n * Registers a callback function to be executed whenever the event is raised.\n * An optional scope can be provided to serve as the this
pointer\n * in which the function will execute.\n *\n * @param {Listener} listener The function to be executed when the event is raised.\n * @param {object} [scope] An optional object scope to serve as the this
\n * pointer in which the listener function will execute.\n * @returns {Event.RemoveCallback} A function that will remove this event listener when invoked.\n *\n * @see Event#raiseEvent\n * @see Event#removeEventListener\n */\nEvent.prototype.addEventListener = function (listener, scope) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.func(\"listener\", listener);\n //>>includeEnd('debug');\n\n this._listeners.push(listener);\n this._scopes.push(scope);\n\n const event = this;\n return function () {\n event.removeEventListener(listener, scope);\n };\n};\n\n/**\n * Unregisters a previously registered callback.\n *\n * @param {Listener} listener The function to be unregistered.\n * @param {object} [scope] The scope that was originally passed to addEventListener.\n * @returns {boolean} true
if the listener was removed; false
if the listener and scope are not registered with the event.\n *\n * @see Event#addEventListener\n * @see Event#raiseEvent\n */\nEvent.prototype.removeEventListener = function (listener, scope) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.func(\"listener\", listener);\n //>>includeEnd('debug');\n\n const listeners = this._listeners;\n const scopes = this._scopes;\n\n let index = -1;\n for (let i = 0; i < listeners.length; i++) {\n if (listeners[i] === listener && scopes[i] === scope) {\n index = i;\n break;\n }\n }\n\n if (index !== -1) {\n if (this._insideRaiseEvent) {\n //In order to allow removing an event subscription from within\n //a callback, we don't actually remove the items here. Instead\n //remember the index they are at and undefined their value.\n this._toRemove.push(index);\n listeners[index] = undefined;\n scopes[index] = undefined;\n } else {\n listeners.splice(index, 1);\n scopes.splice(index, 1);\n }\n return true;\n }\n\n return false;\n};\n\nfunction compareNumber(a, b) {\n return b - a;\n}\n\n/**\n * Raises the event by calling each registered listener with all supplied arguments.\n *\n * @param {...Parameterstrue
if they are equal, false
otherwise.\n *\n * @param {HeadingPitchRoll} [left] The first HeadingPitchRoll.\n * @param {HeadingPitchRoll} [right] The second HeadingPitchRoll.\n * @returns {boolean} true
if left and right are equal, false
otherwise.\n */\nHeadingPitchRoll.equals = function (left, right) {\n return (\n left === right ||\n (defined(left) &&\n defined(right) &&\n left.heading === right.heading &&\n left.pitch === right.pitch &&\n left.roll === right.roll)\n );\n};\n\n/**\n * Compares the provided HeadingPitchRolls componentwise and returns\n * true
if they pass an absolute or relative tolerance test,\n * false
otherwise.\n *\n * @param {HeadingPitchRoll} [left] The first HeadingPitchRoll.\n * @param {HeadingPitchRoll} [right] The second HeadingPitchRoll.\n * @param {number} [relativeEpsilon=0] The relative epsilon tolerance to use for equality testing.\n * @param {number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing.\n * @returns {boolean} true
if left and right are within the provided epsilon, false
otherwise.\n */\nHeadingPitchRoll.equalsEpsilon = function (\n left,\n right,\n relativeEpsilon,\n absoluteEpsilon,\n) {\n return (\n left === right ||\n (defined(left) &&\n defined(right) &&\n CesiumMath.equalsEpsilon(\n left.heading,\n right.heading,\n relativeEpsilon,\n absoluteEpsilon,\n ) &&\n CesiumMath.equalsEpsilon(\n left.pitch,\n right.pitch,\n relativeEpsilon,\n absoluteEpsilon,\n ) &&\n CesiumMath.equalsEpsilon(\n left.roll,\n right.roll,\n relativeEpsilon,\n absoluteEpsilon,\n ))\n );\n};\n\n/**\n * Duplicates this HeadingPitchRoll instance.\n *\n * @param {HeadingPitchRoll} [result] The object onto which to store the result.\n * @returns {HeadingPitchRoll} The modified result parameter or a new HeadingPitchRoll instance if one was not provided.\n */\nHeadingPitchRoll.prototype.clone = function (result) {\n return HeadingPitchRoll.clone(this, result);\n};\n\n/**\n * Compares this HeadingPitchRoll against the provided HeadingPitchRoll componentwise and returns\n * true
if they are equal, false
otherwise.\n *\n * @param {HeadingPitchRoll} [right] The right hand side HeadingPitchRoll.\n * @returns {boolean} true
if they are equal, false
otherwise.\n */\nHeadingPitchRoll.prototype.equals = function (right) {\n return HeadingPitchRoll.equals(this, right);\n};\n\n/**\n * Compares this HeadingPitchRoll against the provided HeadingPitchRoll componentwise and returns\n * true
if they pass an absolute or relative tolerance test,\n * false
otherwise.\n *\n * @param {HeadingPitchRoll} [right] The right hand side HeadingPitchRoll.\n * @param {number} [relativeEpsilon=0] The relative epsilon tolerance to use for equality testing.\n * @param {number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing.\n * @returns {boolean} true
if they are within the provided epsilon, false
otherwise.\n */\nHeadingPitchRoll.prototype.equalsEpsilon = function (\n right,\n relativeEpsilon,\n absoluteEpsilon,\n) {\n return HeadingPitchRoll.equalsEpsilon(\n this,\n right,\n relativeEpsilon,\n absoluteEpsilon,\n );\n};\n\n/**\n * Creates a string representing this HeadingPitchRoll in the format '(heading, pitch, roll)' in radians.\n *\n * @returns {string} A string representing the provided HeadingPitchRoll in the format '(heading, pitch, roll)'.\n */\nHeadingPitchRoll.prototype.toString = function () {\n return `(${this.heading}, ${this.pitch}, ${this.roll})`;\n};\nexport default HeadingPitchRoll;\n","import buildModuleUrl from \"./buildModuleUrl.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport Iau2006XysSample from \"./Iau2006XysSample.js\";\nimport JulianDate from \"./JulianDate.js\";\nimport Resource from \"./Resource.js\";\nimport TimeStandard from \"./TimeStandard.js\";\n\n/**\n * A set of IAU2006 XYS data that is used to evaluate the transformation between the International\n * Celestial Reference Frame (ICRF) and the International Terrestrial Reference Frame (ITRF).\n *\n * @alias Iau2006XysData\n * @constructor\n *\n * @param {object} [options] Object with the following properties:\n * @param {Resource|string} [options.xysFileUrlTemplate='Assets/IAU2006_XYS/IAU2006_XYS_{0}.json'] A template URL for obtaining the XYS data. In the template,\n * `{0}` will be replaced with the file index.\n * @param {number} [options.interpolationOrder=9] The order of interpolation to perform on the XYS data.\n * @param {number} [options.sampleZeroJulianEphemerisDate=2442396.5] The Julian ephemeris date (JED) of the\n * first XYS sample.\n * @param {number} [options.stepSizeDays=1.0] The step size, in days, between successive XYS samples.\n * @param {number} [options.samplesPerXysFile=1000] The number of samples in each XYS file.\n * @param {number} [options.totalSamples=27426] The total number of samples in all XYS files.\n *\n * @private\n */\nfunction Iau2006XysData(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n this._xysFileUrlTemplate = Resource.createIfNeeded(\n options.xysFileUrlTemplate,\n );\n this._interpolationOrder = defaultValue(options.interpolationOrder, 9);\n this._sampleZeroJulianEphemerisDate = defaultValue(\n options.sampleZeroJulianEphemerisDate,\n 2442396.5,\n );\n this._sampleZeroDateTT = new JulianDate(\n this._sampleZeroJulianEphemerisDate,\n 0.0,\n TimeStandard.TAI,\n );\n this._stepSizeDays = defaultValue(options.stepSizeDays, 1.0);\n this._samplesPerXysFile = defaultValue(options.samplesPerXysFile, 1000);\n this._totalSamples = defaultValue(options.totalSamples, 27426);\n this._samples = new Array(this._totalSamples * 3);\n this._chunkDownloadsInProgress = [];\n\n const order = this._interpolationOrder;\n\n // Compute denominators and X values for interpolation.\n const denom = (this._denominators = new Array(order + 1));\n const xTable = (this._xTable = new Array(order + 1));\n\n const stepN = Math.pow(this._stepSizeDays, order);\n\n for (let i = 0; i <= order; ++i) {\n denom[i] = stepN;\n xTable[i] = i * this._stepSizeDays;\n\n for (let j = 0; j <= order; ++j) {\n if (j !== i) {\n denom[i] *= i - j;\n }\n }\n\n denom[i] = 1.0 / denom[i];\n }\n\n // Allocate scratch arrays for interpolation.\n this._work = new Array(order + 1);\n this._coef = new Array(order + 1);\n}\n\nconst julianDateScratch = new JulianDate(0, 0.0, TimeStandard.TAI);\n\nfunction getDaysSinceEpoch(xys, dayTT, secondTT) {\n const dateTT = julianDateScratch;\n dateTT.dayNumber = dayTT;\n dateTT.secondsOfDay = secondTT;\n return JulianDate.daysDifference(dateTT, xys._sampleZeroDateTT);\n}\n\n/**\n * Preloads XYS data for a specified date range.\n *\n * @param {number} startDayTT The Julian day number of the beginning of the interval to preload, expressed in\n * the Terrestrial Time (TT) time standard.\n * @param {number} startSecondTT The seconds past noon of the beginning of the interval to preload, expressed in\n * the Terrestrial Time (TT) time standard.\n * @param {number} stopDayTT The Julian day number of the end of the interval to preload, expressed in\n * the Terrestrial Time (TT) time standard.\n * @param {number} stopSecondTT The seconds past noon of the end of the interval to preload, expressed in\n * the Terrestrial Time (TT) time standard.\n * @returns {PromiseThis will compute quaternions that ensure a squad curve is C1.
\n *\n * @param {Quaternion} q0 The first quaternion.\n * @param {Quaternion} q1 The second quaternion.\n * @param {Quaternion} q2 The third quaternion.\n * @param {Quaternion} result The object onto which to store the result.\n * @returns {Quaternion} The modified result parameter.\n *\n * @see Quaternion#squad\n */\nQuaternion.computeInnerQuadrangle = function (q0, q1, q2, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"q0\", q0);\n Check.typeOf.object(\"q1\", q1);\n Check.typeOf.object(\"q2\", q2);\n Check.typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n\n const qInv = Quaternion.conjugate(q1, squadScratchQuaternion0);\n Quaternion.multiply(qInv, q2, squadScratchQuaternion1);\n const cart0 = Quaternion.log(squadScratchQuaternion1, squadScratchCartesian0);\n\n Quaternion.multiply(qInv, q0, squadScratchQuaternion1);\n const cart1 = Quaternion.log(squadScratchQuaternion1, squadScratchCartesian1);\n\n Cartesian3.add(cart0, cart1, cart0);\n Cartesian3.multiplyByScalar(cart0, 0.25, cart0);\n Cartesian3.negate(cart0, cart0);\n Quaternion.exp(cart0, squadScratchQuaternion0);\n\n return Quaternion.multiply(q1, squadScratchQuaternion0, result);\n};\n\n/**\n * Computes the spherical quadrangle interpolation between quaternions.\n *\n * @param {Quaternion} q0 The first quaternion.\n * @param {Quaternion} q1 The second quaternion.\n * @param {Quaternion} s0 The first inner quadrangle.\n * @param {Quaternion} s1 The second inner quadrangle.\n * @param {number} t The time in [0,1] used to interpolate.\n * @param {Quaternion} result The object onto which to store the result.\n * @returns {Quaternion} The modified result parameter.\n *\n *\n * @example\n * // 1. compute the squad interpolation between two quaternions on a curve\n * const s0 = Cesium.Quaternion.computeInnerQuadrangle(quaternions[i - 1], quaternions[i], quaternions[i + 1], new Cesium.Quaternion());\n * const s1 = Cesium.Quaternion.computeInnerQuadrangle(quaternions[i], quaternions[i + 1], quaternions[i + 2], new Cesium.Quaternion());\n * const q = Cesium.Quaternion.squad(quaternions[i], quaternions[i + 1], s0, s1, t, new Cesium.Quaternion());\n *\n * // 2. compute the squad interpolation as above but where the first quaternion is a end point.\n * const s1 = Cesium.Quaternion.computeInnerQuadrangle(quaternions[0], quaternions[1], quaternions[2], new Cesium.Quaternion());\n * const q = Cesium.Quaternion.squad(quaternions[0], quaternions[1], quaternions[0], s1, t, new Cesium.Quaternion());\n *\n * @see Quaternion#computeInnerQuadrangle\n */\nQuaternion.squad = function (q0, q1, s0, s1, t, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"q0\", q0);\n Check.typeOf.object(\"q1\", q1);\n Check.typeOf.object(\"s0\", s0);\n Check.typeOf.object(\"s1\", s1);\n Check.typeOf.number(\"t\", t);\n Check.typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n\n const slerp0 = Quaternion.slerp(q0, q1, t, squadScratchQuaternion0);\n const slerp1 = Quaternion.slerp(s0, s1, t, squadScratchQuaternion1);\n return Quaternion.slerp(slerp0, slerp1, 2.0 * t * (1.0 - t), result);\n};\n\nconst fastSlerpScratchQuaternion = new Quaternion();\n// eslint-disable-next-line no-loss-of-precision\nconst opmu = 1.90110745351730037;\nconst u = FeatureDetection.supportsTypedArrays() ? new Float32Array(8) : [];\nconst v = FeatureDetection.supportsTypedArrays() ? new Float32Array(8) : [];\nconst bT = FeatureDetection.supportsTypedArrays() ? new Float32Array(8) : [];\nconst bD = FeatureDetection.supportsTypedArrays() ? new Float32Array(8) : [];\n\nfor (let i = 0; i < 7; ++i) {\n const s = i + 1.0;\n const t = 2.0 * s + 1.0;\n u[i] = 1.0 / (s * t);\n v[i] = s / t;\n}\n\nu[7] = opmu / (8.0 * 17.0);\nv[7] = (opmu * 8.0) / 17.0;\n\n/**\n * Computes the spherical linear interpolation or extrapolation at t using the provided quaternions.\n * This implementation is faster than {@link Quaternion#slerp}, but is only accurate up to 10-6.\n *\n * @param {Quaternion} start The value corresponding to t at 0.0.\n * @param {Quaternion} end The value corresponding to t at 1.0.\n * @param {number} t The point along t at which to interpolate.\n * @param {Quaternion} result The object onto which to store the result.\n * @returns {Quaternion} The modified result parameter.\n *\n * @see Quaternion#slerp\n */\nQuaternion.fastSlerp = function (start, end, t, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"start\", start);\n Check.typeOf.object(\"end\", end);\n Check.typeOf.number(\"t\", t);\n Check.typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n\n let x = Quaternion.dot(start, end);\n\n let sign;\n if (x >= 0) {\n sign = 1.0;\n } else {\n sign = -1.0;\n x = -x;\n }\n\n const xm1 = x - 1.0;\n const d = 1.0 - t;\n const sqrT = t * t;\n const sqrD = d * d;\n\n for (let i = 7; i >= 0; --i) {\n bT[i] = (u[i] * sqrT - v[i]) * xm1;\n bD[i] = (u[i] * sqrD - v[i]) * xm1;\n }\n\n const cT =\n sign *\n t *\n (1.0 +\n bT[0] *\n (1.0 +\n bT[1] *\n (1.0 +\n bT[2] *\n (1.0 +\n bT[3] *\n (1.0 +\n bT[4] *\n (1.0 + bT[5] * (1.0 + bT[6] * (1.0 + bT[7]))))))));\n const cD =\n d *\n (1.0 +\n bD[0] *\n (1.0 +\n bD[1] *\n (1.0 +\n bD[2] *\n (1.0 +\n bD[3] *\n (1.0 +\n bD[4] *\n (1.0 + bD[5] * (1.0 + bD[6] * (1.0 + bD[7]))))))));\n\n const temp = Quaternion.multiplyByScalar(\n start,\n cD,\n fastSlerpScratchQuaternion,\n );\n Quaternion.multiplyByScalar(end, cT, result);\n return Quaternion.add(temp, result, result);\n};\n\n/**\n * Computes the spherical quadrangle interpolation between quaternions.\n * An implementation that is faster than {@link Quaternion#squad}, but less accurate.\n *\n * @param {Quaternion} q0 The first quaternion.\n * @param {Quaternion} q1 The second quaternion.\n * @param {Quaternion} s0 The first inner quadrangle.\n * @param {Quaternion} s1 The second inner quadrangle.\n * @param {number} t The time in [0,1] used to interpolate.\n * @param {Quaternion} result The object onto which to store the result.\n * @returns {Quaternion} The modified result parameter or a new instance if none was provided.\n *\n * @see Quaternion#squad\n */\nQuaternion.fastSquad = function (q0, q1, s0, s1, t, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"q0\", q0);\n Check.typeOf.object(\"q1\", q1);\n Check.typeOf.object(\"s0\", s0);\n Check.typeOf.object(\"s1\", s1);\n Check.typeOf.number(\"t\", t);\n Check.typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n\n const slerp0 = Quaternion.fastSlerp(q0, q1, t, squadScratchQuaternion0);\n const slerp1 = Quaternion.fastSlerp(s0, s1, t, squadScratchQuaternion1);\n return Quaternion.fastSlerp(slerp0, slerp1, 2.0 * t * (1.0 - t), result);\n};\n\n/**\n * Compares the provided quaternions componentwise and returns\n *true
if they are equal, false
otherwise.\n *\n * @param {Quaternion} [left] The first quaternion.\n * @param {Quaternion} [right] The second quaternion.\n * @returns {boolean} true
if left and right are equal, false
otherwise.\n */\nQuaternion.equals = function (left, right) {\n return (\n left === right ||\n (defined(left) &&\n defined(right) &&\n left.x === right.x &&\n left.y === right.y &&\n left.z === right.z &&\n left.w === right.w)\n );\n};\n\n/**\n * Compares the provided quaternions componentwise and returns\n * true
if they are within the provided epsilon,\n * false
otherwise.\n *\n * @param {Quaternion} [left] The first quaternion.\n * @param {Quaternion} [right] The second quaternion.\n * @param {number} [epsilon=0] The epsilon to use for equality testing.\n * @returns {boolean} true
if left and right are within the provided epsilon, false
otherwise.\n */\nQuaternion.equalsEpsilon = function (left, right, epsilon) {\n epsilon = defaultValue(epsilon, 0);\n\n return (\n left === right ||\n (defined(left) &&\n defined(right) &&\n Math.abs(left.x - right.x) <= epsilon &&\n Math.abs(left.y - right.y) <= epsilon &&\n Math.abs(left.z - right.z) <= epsilon &&\n Math.abs(left.w - right.w) <= epsilon)\n );\n};\n\n/**\n * An immutable Quaternion instance initialized to (0.0, 0.0, 0.0, 0.0).\n *\n * @type {Quaternion}\n * @constant\n */\nQuaternion.ZERO = Object.freeze(new Quaternion(0.0, 0.0, 0.0, 0.0));\n\n/**\n * An immutable Quaternion instance initialized to (0.0, 0.0, 0.0, 1.0).\n *\n * @type {Quaternion}\n * @constant\n */\nQuaternion.IDENTITY = Object.freeze(new Quaternion(0.0, 0.0, 0.0, 1.0));\n\n/**\n * Duplicates this Quaternion instance.\n *\n * @param {Quaternion} [result] The object onto which to store the result.\n * @returns {Quaternion} The modified result parameter or a new Quaternion instance if one was not provided.\n */\nQuaternion.prototype.clone = function (result) {\n return Quaternion.clone(this, result);\n};\n\n/**\n * Compares this and the provided quaternion componentwise and returns\n * true
if they are equal, false
otherwise.\n *\n * @param {Quaternion} [right] The right hand side quaternion.\n * @returns {boolean} true
if left and right are equal, false
otherwise.\n */\nQuaternion.prototype.equals = function (right) {\n return Quaternion.equals(this, right);\n};\n\n/**\n * Compares this and the provided quaternion componentwise and returns\n * true
if they are within the provided epsilon,\n * false
otherwise.\n *\n * @param {Quaternion} [right] The right hand side quaternion.\n * @param {number} [epsilon=0] The epsilon to use for equality testing.\n * @returns {boolean} true
if left and right are within the provided epsilon, false
otherwise.\n */\nQuaternion.prototype.equalsEpsilon = function (right, epsilon) {\n return Quaternion.equalsEpsilon(this, right, epsilon);\n};\n\n/**\n * Returns a string representing this quaternion in the format (x, y, z, w).\n *\n * @returns {string} A string representing this Quaternion.\n */\nQuaternion.prototype.toString = function () {\n return `(${this.x}, ${this.y}, ${this.z}, ${this.w})`;\n};\nexport default Quaternion;\n","import Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Fullscreen from \"./Fullscreen.js\";\n\nlet theNavigator;\nif (typeof navigator !== \"undefined\") {\n theNavigator = navigator;\n} else {\n theNavigator = {};\n}\n\nfunction extractVersion(versionString) {\n const parts = versionString.split(\".\");\n for (let i = 0, len = parts.length; i < len; ++i) {\n parts[i] = parseInt(parts[i], 10);\n }\n return parts;\n}\n\nlet isChromeResult;\nlet chromeVersionResult;\nfunction isChrome() {\n if (!defined(isChromeResult)) {\n isChromeResult = false;\n // Edge contains Chrome in the user agent too\n if (!isEdge()) {\n const fields = / Chrome\\/([\\.0-9]+)/.exec(theNavigator.userAgent);\n if (fields !== null) {\n isChromeResult = true;\n chromeVersionResult = extractVersion(fields[1]);\n }\n }\n }\n\n return isChromeResult;\n}\n\nfunction chromeVersion() {\n return isChrome() && chromeVersionResult;\n}\n\nlet isSafariResult;\nlet safariVersionResult;\nfunction isSafari() {\n if (!defined(isSafariResult)) {\n isSafariResult = false;\n\n // Chrome and Edge contain Safari in the user agent too\n if (\n !isChrome() &&\n !isEdge() &&\n / Safari\\/[\\.0-9]+/.test(theNavigator.userAgent)\n ) {\n const fields = / Version\\/([\\.0-9]+)/.exec(theNavigator.userAgent);\n if (fields !== null) {\n isSafariResult = true;\n safariVersionResult = extractVersion(fields[1]);\n }\n }\n }\n\n return isSafariResult;\n}\n\nfunction safariVersion() {\n return isSafari() && safariVersionResult;\n}\n\nlet isWebkitResult;\nlet webkitVersionResult;\nfunction isWebkit() {\n if (!defined(isWebkitResult)) {\n isWebkitResult = false;\n\n const fields = / AppleWebKit\\/([\\.0-9]+)(\\+?)/.exec(theNavigator.userAgent);\n if (fields !== null) {\n isWebkitResult = true;\n webkitVersionResult = extractVersion(fields[1]);\n webkitVersionResult.isNightly = !!fields[2];\n }\n }\n\n return isWebkitResult;\n}\n\nfunction webkitVersion() {\n return isWebkit() && webkitVersionResult;\n}\n\nlet isInternetExplorerResult;\nlet internetExplorerVersionResult;\nfunction isInternetExplorer() {\n if (!defined(isInternetExplorerResult)) {\n isInternetExplorerResult = false;\n\n let fields;\n if (theNavigator.appName === \"Microsoft Internet Explorer\") {\n fields = /MSIE ([0-9]{1,}[\\.0-9]{0,})/.exec(theNavigator.userAgent);\n if (fields !== null) {\n isInternetExplorerResult = true;\n internetExplorerVersionResult = extractVersion(fields[1]);\n }\n } else if (theNavigator.appName === \"Netscape\") {\n fields = /Trident\\/.*rv:([0-9]{1,}[\\.0-9]{0,})/.exec(\n theNavigator.userAgent,\n );\n if (fields !== null) {\n isInternetExplorerResult = true;\n internetExplorerVersionResult = extractVersion(fields[1]);\n }\n }\n }\n return isInternetExplorerResult;\n}\n\nfunction internetExplorerVersion() {\n return isInternetExplorer() && internetExplorerVersionResult;\n}\n\nlet isEdgeResult;\nlet edgeVersionResult;\nfunction isEdge() {\n if (!defined(isEdgeResult)) {\n isEdgeResult = false;\n const fields = / Edg\\/([\\.0-9]+)/.exec(theNavigator.userAgent);\n if (fields !== null) {\n isEdgeResult = true;\n edgeVersionResult = extractVersion(fields[1]);\n }\n }\n return isEdgeResult;\n}\n\nfunction edgeVersion() {\n return isEdge() && edgeVersionResult;\n}\n\nlet isFirefoxResult;\nlet firefoxVersionResult;\nfunction isFirefox() {\n if (!defined(isFirefoxResult)) {\n isFirefoxResult = false;\n\n const fields = /Firefox\\/([\\.0-9]+)/.exec(theNavigator.userAgent);\n if (fields !== null) {\n isFirefoxResult = true;\n firefoxVersionResult = extractVersion(fields[1]);\n }\n }\n return isFirefoxResult;\n}\n\nlet isWindowsResult;\nfunction isWindows() {\n if (!defined(isWindowsResult)) {\n isWindowsResult = /Windows/i.test(theNavigator.appVersion);\n }\n return isWindowsResult;\n}\n\nlet isIPadOrIOSResult;\nfunction isIPadOrIOS() {\n if (!defined(isIPadOrIOSResult)) {\n isIPadOrIOSResult =\n navigator.platform === \"iPhone\" ||\n navigator.platform === \"iPod\" ||\n navigator.platform === \"iPad\";\n }\n\n return isIPadOrIOSResult;\n}\n\nfunction firefoxVersion() {\n return isFirefox() && firefoxVersionResult;\n}\n\nlet hasPointerEvents;\nfunction supportsPointerEvents() {\n if (!defined(hasPointerEvents)) {\n //While navigator.pointerEnabled is deprecated in the W3C specification\n //we still need to use it if it exists in order to support browsers\n //that rely on it, such as the Windows WebBrowser control which defines\n //PointerEvent but sets navigator.pointerEnabled to false.\n\n //Firefox disabled because of https://github.com/CesiumGS/cesium/issues/6372\n hasPointerEvents =\n !isFirefox() &&\n typeof PointerEvent !== \"undefined\" &&\n (!defined(theNavigator.pointerEnabled) || theNavigator.pointerEnabled);\n }\n return hasPointerEvents;\n}\n\nlet imageRenderingValueResult;\nlet supportsImageRenderingPixelatedResult;\nfunction supportsImageRenderingPixelated() {\n if (!defined(supportsImageRenderingPixelatedResult)) {\n const canvas = document.createElement(\"canvas\");\n canvas.setAttribute(\n \"style\",\n \"image-rendering: -moz-crisp-edges;\" + \"image-rendering: pixelated;\",\n );\n //canvas.style.imageRendering will be undefined, null or an empty string on unsupported browsers.\n const tmp = canvas.style.imageRendering;\n supportsImageRenderingPixelatedResult = defined(tmp) && tmp !== \"\";\n if (supportsImageRenderingPixelatedResult) {\n imageRenderingValueResult = tmp;\n }\n }\n return supportsImageRenderingPixelatedResult;\n}\n\nfunction imageRenderingValue() {\n return supportsImageRenderingPixelated()\n ? imageRenderingValueResult\n : undefined;\n}\n\nfunction supportsWebP() {\n //>>includeStart('debug', pragmas.debug);\n if (!supportsWebP.initialized) {\n throw new DeveloperError(\n \"You must call FeatureDetection.supportsWebP.initialize and wait for the promise to resolve before calling FeatureDetection.supportsWebP\",\n );\n }\n //>>includeEnd('debug');\n return supportsWebP._result;\n}\nsupportsWebP._promise = undefined;\nsupportsWebP._result = undefined;\nsupportsWebP.initialize = function () {\n // From https://developers.google.com/speed/webp/faq#how_can_i_detect_browser_support_for_webp\n if (defined(supportsWebP._promise)) {\n return supportsWebP._promise;\n }\n\n supportsWebP._promise = new Promise((resolve) => {\n const image = new Image();\n image.onload = function () {\n supportsWebP._result = image.width > 0 && image.height > 0;\n resolve(supportsWebP._result);\n };\n\n image.onerror = function () {\n supportsWebP._result = false;\n resolve(supportsWebP._result);\n };\n image.src =\n \"data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA\";\n });\n\n return supportsWebP._promise;\n};\nObject.defineProperties(supportsWebP, {\n initialized: {\n get: function () {\n return defined(supportsWebP._result);\n },\n },\n});\n\nconst typedArrayTypes = [];\nif (typeof ArrayBuffer !== \"undefined\") {\n typedArrayTypes.push(\n Int8Array,\n Uint8Array,\n Int16Array,\n Uint16Array,\n Int32Array,\n Uint32Array,\n Float32Array,\n Float64Array,\n );\n\n if (typeof Uint8ClampedArray !== \"undefined\") {\n typedArrayTypes.push(Uint8ClampedArray);\n }\n\n if (typeof Uint8ClampedArray !== \"undefined\") {\n typedArrayTypes.push(Uint8ClampedArray);\n }\n\n if (typeof BigInt64Array !== \"undefined\") {\n // eslint-disable-next-line no-undef\n typedArrayTypes.push(BigInt64Array);\n }\n\n if (typeof BigUint64Array !== \"undefined\") {\n // eslint-disable-next-line no-undef\n typedArrayTypes.push(BigUint64Array);\n }\n}\n\n/**\n * A set of functions to detect whether the current browser supports\n * various features.\n *\n * @namespace FeatureDetection\n */\nconst FeatureDetection = {\n isChrome: isChrome,\n chromeVersion: chromeVersion,\n isSafari: isSafari,\n safariVersion: safariVersion,\n isWebkit: isWebkit,\n webkitVersion: webkitVersion,\n isInternetExplorer: isInternetExplorer,\n internetExplorerVersion: internetExplorerVersion,\n isEdge: isEdge,\n edgeVersion: edgeVersion,\n isFirefox: isFirefox,\n firefoxVersion: firefoxVersion,\n isWindows: isWindows,\n isIPadOrIOS: isIPadOrIOS,\n hardwareConcurrency: defaultValue(theNavigator.hardwareConcurrency, 3),\n supportsPointerEvents: supportsPointerEvents,\n supportsImageRenderingPixelated: supportsImageRenderingPixelated,\n supportsWebP: supportsWebP,\n imageRenderingValue: imageRenderingValue,\n typedArrayTypes: typedArrayTypes,\n};\n\n/**\n * Detects whether the current browser supports Basis Universal textures and the web assembly modules needed to transcode them.\n *\n * @param {Scene} scene\n * @returns {boolean} true if the browser supports web assembly modules and the scene supports Basis Universal textures, false if not.\n */\nFeatureDetection.supportsBasis = function (scene) {\n return FeatureDetection.supportsWebAssembly() && scene.context.supportsBasis;\n};\n\n/**\n * Detects whether the current browser supports the full screen standard.\n *\n * @returns {boolean} true if the browser supports the full screen standard, false if not.\n *\n * @see Fullscreen\n * @see {@link http://dvcs.w3.org/hg/fullscreen/raw-file/tip/Overview.html|W3C Fullscreen Living Specification}\n */\nFeatureDetection.supportsFullscreen = function () {\n return Fullscreen.supportsFullscreen();\n};\n\n/**\n * Detects whether the current browser supports typed arrays.\n *\n * @returns {boolean} true if the browser supports typed arrays, false if not.\n *\n * @see {@link https://tc39.es/ecma262/#sec-typedarray-objects|Typed Array Specification}\n */\nFeatureDetection.supportsTypedArrays = function () {\n return typeof ArrayBuffer !== \"undefined\";\n};\n\n/**\n * Detects whether the current browser supports BigInt64Array typed arrays.\n *\n * @returns {boolean} true if the browser supports BigInt64Array typed arrays, false if not.\n *\n * @see {@link https://tc39.es/ecma262/#sec-typedarray-objects|Typed Array Specification}\n */\nFeatureDetection.supportsBigInt64Array = function () {\n return typeof BigInt64Array !== \"undefined\";\n};\n\n/**\n * Detects whether the current browser supports BigUint64Array typed arrays.\n *\n * @returns {boolean} true if the browser supports BigUint64Array typed arrays, false if not.\n *\n * @see {@link https://tc39.es/ecma262/#sec-typedarray-objects|Typed Array Specification}\n */\nFeatureDetection.supportsBigUint64Array = function () {\n return typeof BigUint64Array !== \"undefined\";\n};\n\n/**\n * Detects whether the current browser supports BigInt.\n *\n * @returns {boolean} true if the browser supports BigInt, false if not.\n *\n * @see {@link https://tc39.es/ecma262/#sec-bigint-objects|BigInt Specification}\n */\nFeatureDetection.supportsBigInt = function () {\n return typeof BigInt !== \"undefined\";\n};\n\n/**\n * Detects whether the current browser supports Web Workers.\n *\n * @returns {boolean} true if the browsers supports Web Workers, false if not.\n *\n * @see {@link http://www.w3.org/TR/workers/}\n */\nFeatureDetection.supportsWebWorkers = function () {\n return typeof Worker !== \"undefined\";\n};\n\n/**\n * Detects whether the current browser supports Web Assembly.\n *\n * @returns {boolean} true if the browsers supports Web Assembly, false if not.\n *\n * @see {@link https://developer.mozilla.org/en-US/docs/WebAssembly}\n */\nFeatureDetection.supportsWebAssembly = function () {\n return typeof WebAssembly !== \"undefined\";\n};\n\n/**\n * Detects whether the current browser supports a WebGL2 rendering context for the specified scene.\n *\n * @param {Scene} scene the Cesium scene specifying the rendering context\n * @returns {boolean} true if the browser supports a WebGL2 rendering context, false if not.\n *\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext|WebGL2RenderingContext}\n */\nFeatureDetection.supportsWebgl2 = function (scene) {\n //>>includeStart('debug', pragmas.debug);\n Check.defined(\"scene\", scene);\n //>>includeEnd('debug');\n\n return scene.context.webgl2;\n};\n\n/**\n * Detects whether the current browser supports ECMAScript modules in web workers.\n * @returns {boolean} true if the browser supports ECMAScript modules in web workers.\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Worker|Worker}\n */\nFeatureDetection.supportsEsmWebWorkers = function () {\n return !isFirefox() || parseInt(firefoxVersionResult) >= 114;\n};\n\nexport default FeatureDetection;\n","import defined from \"./defined.js\";\n\nlet _supportsFullscreen;\nconst _names = {\n requestFullscreen: undefined,\n exitFullscreen: undefined,\n fullscreenEnabled: undefined,\n fullscreenElement: undefined,\n fullscreenchange: undefined,\n fullscreenerror: undefined,\n};\n\n/**\n * Browser-independent functions for working with the standard fullscreen API.\n *\n * @namespace Fullscreen\n *\n * @see {@link http://dvcs.w3.org/hg/fullscreen/raw-file/tip/Overview.html|W3C Fullscreen Living Specification}\n */\nconst Fullscreen = {};\n\nObject.defineProperties(Fullscreen, {\n /**\n * The element that is currently fullscreen, if any. To simply check if the\n * browser is in fullscreen mode or not, use {@link Fullscreen#fullscreen}.\n * @memberof Fullscreen\n * @type {object}\n * @readonly\n */\n element: {\n get: function () {\n if (!Fullscreen.supportsFullscreen()) {\n return undefined;\n }\n\n return document[_names.fullscreenElement];\n },\n },\n\n /**\n * The name of the event on the document that is fired when fullscreen is\n * entered or exited. This event name is intended for use with addEventListener.\n * In your event handler, to determine if the browser is in fullscreen mode or not,\n * use {@link Fullscreen#fullscreen}.\n * @memberof Fullscreen\n * @type {string}\n * @readonly\n */\n changeEventName: {\n get: function () {\n if (!Fullscreen.supportsFullscreen()) {\n return undefined;\n }\n\n return _names.fullscreenchange;\n },\n },\n\n /**\n * The name of the event that is fired when a fullscreen error\n * occurs. This event name is intended for use with addEventListener.\n * @memberof Fullscreen\n * @type {string}\n * @readonly\n */\n errorEventName: {\n get: function () {\n if (!Fullscreen.supportsFullscreen()) {\n return undefined;\n }\n\n return _names.fullscreenerror;\n },\n },\n\n /**\n * Determine whether the browser will allow an element to be made fullscreen, or not.\n * For example, by default, iframes cannot go fullscreen unless the containing page\n * adds an \"allowfullscreen\" attribute (or prefixed equivalent).\n * @memberof Fullscreen\n * @type {boolean}\n * @readonly\n */\n enabled: {\n get: function () {\n if (!Fullscreen.supportsFullscreen()) {\n return undefined;\n }\n\n return document[_names.fullscreenEnabled];\n },\n },\n\n /**\n * Determines if the browser is currently in fullscreen mode.\n * @memberof Fullscreen\n * @type {boolean}\n * @readonly\n */\n fullscreen: {\n get: function () {\n if (!Fullscreen.supportsFullscreen()) {\n return undefined;\n }\n\n return Fullscreen.element !== null;\n },\n },\n});\n\n/**\n * Detects whether the browser supports the standard fullscreen API.\n *\n * @returns {boolean} true
if the browser supports the standard fullscreen API,\n * false
otherwise.\n */\nFullscreen.supportsFullscreen = function () {\n if (defined(_supportsFullscreen)) {\n return _supportsFullscreen;\n }\n\n _supportsFullscreen = false;\n\n const body = document.body;\n if (typeof body.requestFullscreen === \"function\") {\n // go with the unprefixed, standard set of names\n _names.requestFullscreen = \"requestFullscreen\";\n _names.exitFullscreen = \"exitFullscreen\";\n _names.fullscreenEnabled = \"fullscreenEnabled\";\n _names.fullscreenElement = \"fullscreenElement\";\n _names.fullscreenchange = \"fullscreenchange\";\n _names.fullscreenerror = \"fullscreenerror\";\n _supportsFullscreen = true;\n return _supportsFullscreen;\n }\n\n //check for the correct combination of prefix plus the various names that browsers use\n const prefixes = [\"webkit\", \"moz\", \"o\", \"ms\", \"khtml\"];\n let name;\n for (let i = 0, len = prefixes.length; i < len; ++i) {\n const prefix = prefixes[i];\n\n // casing of Fullscreen differs across browsers\n name = `${prefix}RequestFullscreen`;\n if (typeof body[name] === \"function\") {\n _names.requestFullscreen = name;\n _supportsFullscreen = true;\n } else {\n name = `${prefix}RequestFullScreen`;\n if (typeof body[name] === \"function\") {\n _names.requestFullscreen = name;\n _supportsFullscreen = true;\n }\n }\n\n // disagreement about whether it's \"exit\" as per spec, or \"cancel\"\n name = `${prefix}ExitFullscreen`;\n if (typeof document[name] === \"function\") {\n _names.exitFullscreen = name;\n } else {\n name = `${prefix}CancelFullScreen`;\n if (typeof document[name] === \"function\") {\n _names.exitFullscreen = name;\n }\n }\n\n // casing of Fullscreen differs across browsers\n name = `${prefix}FullscreenEnabled`;\n if (document[name] !== undefined) {\n _names.fullscreenEnabled = name;\n } else {\n name = `${prefix}FullScreenEnabled`;\n if (document[name] !== undefined) {\n _names.fullscreenEnabled = name;\n }\n }\n\n // casing of Fullscreen differs across browsers\n name = `${prefix}FullscreenElement`;\n if (document[name] !== undefined) {\n _names.fullscreenElement = name;\n } else {\n name = `${prefix}FullScreenElement`;\n if (document[name] !== undefined) {\n _names.fullscreenElement = name;\n }\n }\n\n // thankfully, event names are all lowercase per spec\n name = `${prefix}fullscreenchange`;\n // event names do not have 'on' in the front, but the property on the document does\n if (document[`on${name}`] !== undefined) {\n //except on IE\n if (prefix === \"ms\") {\n name = \"MSFullscreenChange\";\n }\n _names.fullscreenchange = name;\n }\n\n name = `${prefix}fullscreenerror`;\n if (document[`on${name}`] !== undefined) {\n //except on IE\n if (prefix === \"ms\") {\n name = \"MSFullscreenError\";\n }\n _names.fullscreenerror = name;\n }\n }\n\n return _supportsFullscreen;\n};\n\n/**\n * Asynchronously requests the browser to enter fullscreen mode on the given element.\n * If fullscreen mode is not supported by the browser, does nothing.\n *\n * @param {object} element The HTML element which will be placed into fullscreen mode.\n * @param {object} [vrDevice] The HMDVRDevice device.\n *\n * @example\n * // Put the entire page into fullscreen.\n * Cesium.Fullscreen.requestFullscreen(document.body)\n *\n * // Place only the Cesium canvas into fullscreen.\n * Cesium.Fullscreen.requestFullscreen(scene.canvas)\n */\nFullscreen.requestFullscreen = function (element, vrDevice) {\n if (!Fullscreen.supportsFullscreen()) {\n return;\n }\n\n element[_names.requestFullscreen]({ vrDisplay: vrDevice });\n};\n\n/**\n * Asynchronously exits fullscreen mode. If the browser is not currently\n * in fullscreen, or if fullscreen mode is not supported by the browser, does nothing.\n */\nFullscreen.exitFullscreen = function () {\n if (!Fullscreen.supportsFullscreen()) {\n return;\n }\n\n document[_names.exitFullscreen]();\n};\n\n//For unit tests\nFullscreen._names = _names;\nexport default Fullscreen;\n"],"names":["$6fb706f4a1c1ff12$var$a","$b1dcbeb8d31d71ff$var$supportsImageBitmapOptionsPromise","$b73be531cd978718$var$a","$b73be531cd978718$var$baseResource","$b73be531cd978718$var$implementation","$19a47bf34378ad7c$var$_supportsFullscreen","$da149e13e9eaa5f6$var$theNavigator","$da149e13e9eaa5f6$var$isChromeResult","$da149e13e9eaa5f6$var$chromeVersionResult","$da149e13e9eaa5f6$var$isSafariResult","$da149e13e9eaa5f6$var$safariVersionResult","$da149e13e9eaa5f6$var$isWebkitResult","$da149e13e9eaa5f6$var$webkitVersionResult","$da149e13e9eaa5f6$var$isInternetExplorerResult","$da149e13e9eaa5f6$var$internetExplorerVersionResult","$da149e13e9eaa5f6$var$isEdgeResult","$da149e13e9eaa5f6$var$edgeVersionResult","$da149e13e9eaa5f6$var$isFirefoxResult","$da149e13e9eaa5f6$var$firefoxVersionResult","$da149e13e9eaa5f6$var$isWindowsResult","$da149e13e9eaa5f6$var$isIPadOrIOSResult","$da149e13e9eaa5f6$var$hasPointerEvents","$da149e13e9eaa5f6$var$imageRenderingValueResult","$da149e13e9eaa5f6$var$supportsImageRenderingPixelatedResult","t","root","factory","$parcel$global","globalThis","$parcel$interopDefault","a","__esModule","default","$parcel$modules","$parcel$inits","parcelRequire","id","exports","init","module","call","err","Error","code","register","parcelRegister","freeExports","nodeType","freeModule","freeGlobal","global","window","self","punycode","key","regexPunycode","regexNonASCII","regexSeparators","errors","floor","Math","stringFromCharCode","String","fromCharCode","error","type","RangeError","map","array","fn","length","result","mapDomain","string","parts","split","replace","join","ucs2decode","value","extra","output","counter","charCodeAt","push","ucs2encode","digitToBasic","digit","flag","adapt","delta","numPoints","firstTime","k","baseMinusTMin","base","decode","input","codePoint","out","basic","j","index","oldi","w","baseMinusT","inputLength","i","n","bias","lastIndexOf","maxInt","splice","encode","handledCPCount","basicLength","m","q","currentValue","handledCPCountPlusOne","qMinusT","test","slice","toLowerCase","define","amd","hasOwnProperty","_IPv6","IPv6","best","address","pos","_segments","segments","_address","total","shift","pop","indexOf","_best","_current","current","inzeroes","noConflict","_SecondLevelDomains","SecondLevelDomains","SLD","list","has","domain","tldOffset","sldOffset","sldList","is","get","$800sp","$jJTNo","$3baabda811939da5$export$befdefbdce210f91","constructor","_$AU","_$AM","_$AT","e","_$AS","update","render","$74d80410d825d70d$var$ee","$74d80410d825d70d$var$ie","$74d80410d825d70d$export$1e5b4ce2fa884e6a","name","strings","Object","keys","reduce","r","s","includes","style","element","ft","Set","delete","removeProperty","add","endsWith","setProperty","noChange","_$litDirective$","values","$kWQjc","$bXwZF","$3pzcG","$8w8ZH","$jQJji","$AXvpI","$1vHsR","$667f84b0348f3801$var$scaleToGeodeticSurfaceIntersection","$667f84b0348f3801$var$scaleToGeodeticSurfaceGradient","$667f84b0348f3801$export$2e2bcd8739ae039","cartesian","oneOverRadii","oneOverRadiiSquared","centerToleranceSquared","func","xMultiplier","yMultiplier","zMultiplier","xMultiplier2","yMultiplier2","zMultiplier2","xMultiplier3","yMultiplier3","zMultiplier3","positionX","x","positionY","y","positionZ","z","oneOverRadiiX","oneOverRadiiY","oneOverRadiiZ","x2","y2","z2","squaredNorm","ratio","sqrt","intersection","multiplyByScalar","isFinite","clone","undefined","oneOverRadiiSquaredX","oneOverRadiiSquaredY","oneOverRadiiSquaredZ","gradient","lambda","magnitude","correction","abs","EPSILON12","$69f9194a3ef67d4b$var$Cartographic","longitude","latitude","height","fromRadians","typeOf","number","fromDegrees","toRadians","$69f9194a3ef67d4b$var$cartesianToCartographicN","$69f9194a3ef67d4b$var$cartesianToCartographicP","$69f9194a3ef67d4b$var$cartesianToCartographicH","_ellipsoidOneOverRadii","_ellipsoidOneOverRadiiSquared","_ellipsoidCenterToleranceSquared","EPSILON1","fromCartesian","ellipsoid","p","_centerToleranceSquared","multiplyComponents","normalize","h","subtract","atan2","asin","sign","dot","toCartesian","cartographic","defined","equals","left","right","equalsEpsilon","epsilon","ZERO","freeze","prototype","toString","$5237444a2d786ec9$var$initialize","greaterThanOrEquals","_radii","_radiiSquared","_radiiToTheFourth","_oneOverRadii","_oneOverRadiiSquared","_minimumRadius","min","_maximumRadius","max","_squaredXOverSquaredZ","$5237444a2d786ec9$var$Ellipsoid","defineProperties","radii","radiiSquared","radiiToTheFourth","minimumRadius","maximumRadius","fromCartesian3","WGS84","UNIT_SPHERE","MOON","LUNAR_RADIUS","_default","set","object","_ellipsoidRadiiSquared","packedLength","pack","startingIndex","unpack","geocentricSurfaceNormal","geodeticSurfaceNormalCartographic","cosLatitude","cos","sin","geodeticSurfaceNormal","isNaN","EPSILON14","$5237444a2d786ec9$var$cartographicToCartesianNormal","$5237444a2d786ec9$var$cartographicToCartesianK","cartographicToCartesian","gamma","divideByScalar","cartographicArrayToCartesianArray","cartographics","Array","$5237444a2d786ec9$var$cartesianToCartographicN","$5237444a2d786ec9$var$cartesianToCartographicP","$5237444a2d786ec9$var$cartesianToCartographicH","cartesianToCartographic","scaleToGeodeticSurface","cartesianArrayToCartographicArray","cartesians","scaleToGeocentricSurface","beta","transformPositionToScaledSpace","position","transformPositionFromScaledSpace","getSurfaceNormalIntersectionWithZAxis","buffer","EPSILON15","greaterThan","squaredXOverSquaredZ","$5237444a2d786ec9$var$scratchEndpoint","getLocalCurvature","surfacePosition","primeVerticalEndpoint","primeVerticalRadius","distance","radiusRatio","fromElements","$5237444a2d786ec9$var$abscissas","$5237444a2d786ec9$var$weights","$5237444a2d786ec9$var$gaussLegendreQuadrature","b","xMean","xRange","sum","dx","surfaceArea","rectangle","minLongitude","west","maxLongitude","east","minLatitude","south","maxLatitude","north","TWO_PI","a2","b2","c2","a2b2","lat","sinPhi","cosPhi","lon","cosTheta","sinTheta","$dba8420c01d8a224$var$Cartesian4","fromColor","color","red","green","blue","alpha","packArray","resultLength","isArray","unpackArray","fromArray","maximumComponent","minimumComponent","minimumByComponent","first","second","maximumByComponent","clamp","magnitudeSquared","$dba8420c01d8a224$var$distanceScratch","distanceSquared","divideComponents","scalar","negate","$dba8420c01d8a224$var$lerpScratch","lerp","start","end","$dba8420c01d8a224$var$mostOrthogonalAxisScratch","mostOrthogonalAxis","f","UNIT_X","UNIT_W","UNIT_Z","UNIT_Y","equalsArray","offset","relativeEpsilon","absoluteEpsilon","ONE","$dba8420c01d8a224$var$scratchF32Array","Float32Array","$dba8420c01d8a224$var$scratchU8Array","Uint8Array","$dba8420c01d8a224$var$littleEndian","$dba8420c01d8a224$var$testU8","$dba8420c01d8a224$var$testU32","Uint32Array","packFloat","unpackFloat","packedFloat","$490279d1ff27cf6c$var$Matrix3","column0Row0","column1Row0","column2Row0","column0Row1","column1Row1","column2Row1","column0Row2","column1Row2","column2Row2","matrix","fromColumnMajorArray","fromRowMajorArray","fromQuaternion","quaternion","xy","xz","xw","yz","yw","zw","w2","m00","m01","m02","m10","m11","m12","m20","m21","m22","fromHeadingPitchRoll","headingPitchRoll","pitch","cosPsi","heading","roll","sinPsi","fromScale","scale","fromUniformScale","fromCrossProduct","vector","fromRotationX","angle","cosAngle","sinAngle","fromRotationY","fromRotationZ","toArray","getElementIndex","column","row","lessThanOrEquals","getColumn","startIndex","setColumn","getRow","setRow","$490279d1ff27cf6c$var$scaleScratch1","setScale","existingScale","getScale","scaleRatioX","scaleRatioY","scaleRatioZ","$490279d1ff27cf6c$var$scaleScratch2","setUniformScale","$490279d1ff27cf6c$var$scratchColumn","$490279d1ff27cf6c$var$scaleScratch3","getMaximumScale","$490279d1ff27cf6c$var$scaleScratch4","setRotation","rotation","$490279d1ff27cf6c$var$scaleScratch5","getRotation","multiply","multiplyByVector","vX","vY","vZ","multiplyByScale","multiplyByUniformScale","transpose","$490279d1ff27cf6c$var$rowVal","$490279d1ff27cf6c$var$colVal","$490279d1ff27cf6c$var$jMatrix","$490279d1ff27cf6c$var$jMatrixTranspose","computeEigenDecomposition","tolerance","EPSILON20","count","sweep","unitaryMatrix","unitary","IDENTITY","diagMatrix","diagonal","$490279d1ff27cf6c$var$computeFrobeniusNorm","norm","temp","$490279d1ff27cf6c$var$offDiagonalFrobeniusNorm","$490279d1ff27cf6c$var$shurDecomposition","maxDiagonal","rotAxis","c","tau","qq","determinant","m31","m32","m13","m23","m33","inverse","$490279d1ff27cf6c$var$scratchTransposeMatrix","inverseTranspose","COLUMN0ROW0","COLUMN0ROW1","COLUMN0ROW2","COLUMN1ROW0","COLUMN1ROW1","COLUMN1ROW2","COLUMN2ROW0","COLUMN2ROW1","COLUMN2ROW2","$60086b06bf5db23f$var$RuntimeError","message","stack","$7ec6ab76c28fee32$var$Matrix4","column3Row0","column3Row1","column3Row2","column0Row3","column1Row3","column2Row3","column3Row3","create","str","fromRotationTranslation","translation","fromTranslationQuaternionRotationScale","scaleX","scaleY","scaleZ","fromTranslationRotationScale","translationRotationScale","fromTranslation","fromRotation","$7ec6ab76c28fee32$var$fromCameraF","$7ec6ab76c28fee32$var$fromCameraR","$7ec6ab76c28fee32$var$fromCameraU","fromCamera","camera","direction","up","cross","sX","sY","sZ","fX","fY","fZ","uX","uY","uZ","t0","t1","t2","computePerspectiveFieldOfView","fovY","aspectRatio","near","far","lessThan","PI","tan","computeOrthographicOffCenter","bottom","top","tx","ty","tz","computePerspectiveOffCenter","computeInfinitePerspectiveOffCenter","computeViewportTransformation","viewport","nearDepthRange","farDepthRange","EMPTY_OBJECT","width","halfWidth","halfHeight","halfDepth","computeView","setTranslation","$7ec6ab76c28fee32$var$scaleScratch1","$7ec6ab76c28fee32$var$scaleScratch2","$7ec6ab76c28fee32$var$scratchColumn","$7ec6ab76c28fee32$var$scaleScratch3","$7ec6ab76c28fee32$var$scaleScratch4","$7ec6ab76c28fee32$var$scaleScratch5","left0","left1","left2","left3","left4","left5","left6","left7","left8","left9","left10","left11","left12","left13","left14","left15","right0","right1","right2","right3","right4","right5","right6","right7","right8","right9","right10","right11","right12","right13","right14","right15","multiplyTransformation","multiplyByMatrix3","multiplyByTranslation","vW","multiplyByPointAsVector","multiplyByPoint","matrix1","matrix2","matrix3","matrix6","matrix7","matrix11","getTranslation","getMatrix3","$7ec6ab76c28fee32$var$scratchInverseRotation","$7ec6ab76c28fee32$var$scratchMatrix3Zero","$7ec6ab76c28fee32$var$scratchBottomRow","$7ec6ab76c28fee32$var$scratchExpectedBottomRow","src0","src1","src2","src3","src4","src5","src6","src7","src8","src9","src10","src11","src12","src13","src14","src15","tmp0","tmp1","tmp2","tmp3","tmp4","tmp5","tmp6","tmp7","tmp8","tmp9","tmp10","tmp11","dst0","dst1","dst2","dst3","dst4","dst5","dst6","dst7","dst8","dst9","dst10","dst11","dst12","dst13","dst14","dst15","det","EPSILON21","EPSILON7","inverseTransformation","matrix0","matrix4","matrix5","matrix8","matrix9","matrix10","$7ec6ab76c28fee32$var$scratchTransposeMatrix","COLUMN0ROW3","COLUMN1ROW3","COLUMN2ROW3","COLUMN3ROW0","COLUMN3ROW1","COLUMN3ROW2","COLUMN3ROW3","$9btZb","$52c19b09ece4c63f$export$2e2bcd8739ae039","itemToFind","comparator","comparison","low","high","$733293b70aae4cad$export$2e2bcd8739ae039","xPoleWander","yPoleWander","xPoleOffset","yPoleOffset","ut1MinusUtc","$86dc94fb6bcfc713$export$2e2bcd8739ae039","year","$33ab1ce7e2935ae4$var$daysInYear","$33ab1ce7e2935ae4$export$2e2bcd8739ae039","month","day","hour","minute","millisecond","isLeapSecond","bool","maximumSecond","validateDate","daysInMonth","$97869fccaa735547$export$2e2bcd8739ae039","date","julianDate","$e3d50c782acbaff1$export$2e2bcd8739ae039","SECONDS_PER_MILLISECOND","SECONDS_PER_MINUTE","MINUTES_PER_HOUR","HOURS_PER_DAY","SECONDS_PER_HOUR","MINUTES_PER_DAY","SECONDS_PER_DAY","DAYS_PER_JULIAN_CENTURY","PICOSECOND","MODIFIED_JULIAN_DATE_DIFFERENCE","$134462e760c5c083$export$2e2bcd8739ae039","UTC","TAI","$73b9691e04761700$var$gregorianDateScratch","$73b9691e04761700$var$daysInMonth","$73b9691e04761700$var$compareLeapSecondDates","leapSecond","dateToFind","$73b9691e04761700$var$JulianDate","compare","$73b9691e04761700$var$binarySearchScratchLeapSecond","$73b9691e04761700$var$convertUtcToTai","leapSeconds","difference","secondsDifference","addSeconds","$73b9691e04761700$var$convertTaiToUtc","$73b9691e04761700$var$setComponents","wholeDays","secondsOfDay","extraDays","dayNumber","$73b9691e04761700$var$computeJulianDateComponents","$73b9691e04761700$var$matchCalendarYear","$73b9691e04761700$var$matchCalendarMonth","$73b9691e04761700$var$matchOrdinalDate","$73b9691e04761700$var$matchWeekDate","$73b9691e04761700$var$matchCalendarDate","$73b9691e04761700$var$utcOffset","$73b9691e04761700$var$matchHours","source","$73b9691e04761700$var$matchHoursMinutes","$73b9691e04761700$var$matchHoursMinutesSeconds","$73b9691e04761700$var$iso8601ErrorMessage","julianDayNumber","timeStandard","fromGregorianDate","components","fromDate","Date","getTime","getUTCFullYear","getUTCMonth","getUTCDate","getUTCHours","getUTCMinutes","getUTCSeconds","getUTCMilliseconds","fromIso8601","iso8601String","tmp","inLeapYear","dashCount","offsetIndex","tokens","time","match","dayOfYear","weekNumber","dayOfWeek","january4","getUTCDay","setUTCDate","offsetHours","offsetMinutes","getTimezoneOffset","now","$73b9691e04761700$var$toGregorianDateScratch","toGregorianDate","thisUtc","L","N","I","J","remainingSeconds","toDate","gDate","toIso8601","precision","millisecondStr","toFixed","padStart","julianDayNumberDifference","totalDays","dayDifference","daysDifference","computeTaiMinusUtc","seconds","addMinutes","minutes","newSecondsOfDay","addHours","hours","addDays","days","$f3b7c43a7f0c8e85$exports","_part","_URI","URI","url","_urlSupplied","arguments","_baseSupplied","TypeError","location","href","absoluteTo","version","hasOwn","escapeRegEx","getType","obj","filterArrayValues","data","lookup","arrayContains","_type","arraysEqual","one","two","sort","l","trimSlashes","text","escapeForDumbFirefox36","escape","strictEncodeURIComponent","encodeURIComponent","_parts","protocol","username","password","hostname","urn","port","path","query","fragment","preventInvalidHostname","duplicateQueryParameters","escapeQuerySpace","protocol_expression","idn_expression","punycode_expression","ip4_expression","ip6_expression","find_uri_expression","findUri","trim","parens","leading_whitespace_expression","ascii_tab_whitespace","defaultPorts","http","https","ftp","gopher","ws","wss","hostProtocols","invalid_hostname_characters","domAttributes","getDomAttribute","node","nodeName","decodeURIComponent","iso8859","unescape","unicode","characters","pathname","expression","reserved","urnpath","encodeQuery","escaped","decodeQuery","generateAccessor","_group","generateSegmentedPathFunction","_sep","_codingFuncName","_innerCodingFuncName","actualCodingFunc","generateSimpleAccessor","v","build","generatePrefixAccessor","_key","charAt","substring","decodePath","decodeUrnPath","recodePath","recodeUrnPath","encodeReserved","parse","parseAuthority","parseHost","bracketPos","firstColon","firstSlash","nextColon","ensureValidHostname","ensureValidPort","parseUserinfo","_string","parseQuery","items","splits","requireAbsolutePath","buildAuthority","buildHost","buildUserinfo","buildQuery","unique","buildQueryParameter","addQuery","concat","setQuery","removeQuery","hasQuery","withinArray","Boolean","op","joinPaths","nonEmptySegments","segment","uri","commonPath","withinString","callback","options","_start","_end","_trim","_parens","_attributeOpen","lastIndex","exec","ignoreHtml","attributeOpen","search","parensEnd","parensMatch","ignore","hasHostname","rejectEmptyHostname","toASCII","Number","isInteger","removeAll","unconflicted","URITemplate","deferBuild","_deferred_build","valueOf","hash","res","_object","attribute","src","what","ip","ip4","ip6","sld","idn","relative","_protocol","_port","_hostname","scheme","origin","authority","host","userinfo","resource","subdomain","RegExp","tld","ReferenceError","directory","filename","decodePathSegment","mutatedDirectory","normalizePath","suffix","separator","absolute","unshift","segmentCoded","setSearch","addSearch","removeSearch","hasSearch","normalizeProtocol","normalizeQuery","normalizeFragment","normalizeHostname","normalizePort","_was_relative","_parent","_pos","_path","_leadingParents","normalizePathname","normalizeSearch","normalizeHash","d","readable","toUnicode","qp","kv","basedir","resolved","properties","relativeTo","relativeParts","baseParts","common","relativePath","basePath","parents","one_query","two_query","one_map","two_map","checked","$3f52ff37d0636f55$export$2e2bcd8739ae039","$3f52ff37d0636f55$var$clone","deep","propertyName","$8e522a73a8dfbfe2$export$2e2bcd8739ae039","$8e522a73a8dfbfe2$var$combine","object1","object2","property","object1Value","object2Value","object1Defined","object2Defined","$6e11a2ab1ac0872e$export$2e2bcd8739ae039","resolve","reject","promise","Promise","rej","$5d7f3681ccbe43e2$var$getAbsoluteUri","documentObject","document","_implementation","baseURI","relativeUri","$d4cdc3514a25210c$export$2e2bcd8739ae039","includeQuery","$dce14f3284a3bc25$export$2e2bcd8739ae039","uriObject","substr","$5db98adec2cfcc7b$var$context2DsByWidthAndHeight","$5db98adec2cfcc7b$export$2e2bcd8739ae039","image","context2DsByHeight","context2d","canvas","createElement","getContext","willReadFrequently","globalCompositeOperation","drawImage","getImageData","$9f0272ac2370f543$var$blobUriRegex","$9f0272ac2370f543$export$2e2bcd8739ae039","$6fb706f4a1c1ff12$export$2e2bcd8739ae039","$9cb2c183cad552bd$var$dataUriRegex","$9cb2c183cad552bd$export$2e2bcd8739ae039","$e3fa9c82e19e3667$export$2e2bcd8739ae039","script","async","crossOriginIsolated","setAttribute","head","getElementsByTagName","onload","removeChild","onerror","appendChild","$cdf3d7de0c82329e$export$2e2bcd8739ae039","propName","part","len","$cec685f2ea286a8a$export$2e2bcd8739ae039","queryString","subparts","resultValue","$3f5372c4ce85d94e$export$2e2bcd8739ae039","UNISSUED","ISSUED","ACTIVE","RECEIVED","CANCELLED","FAILED","$a60081784b299462$export$2e2bcd8739ae039","TERRAIN","IMAGERY","TILES3D","OTHER","$b1445a5361079efc$var$Request","throttleByServer","throttle","requestFunction","cancelFunction","priorityFunction","priority","serverKey","state","deferred","cancelled","cancel","$caa58768bf1ed120$export$2e2bcd8739ae039","headerString","headers","headerPairs","headerPair","val","$91769fedd238ef04$var$RequestErrorEvent","statusCode","response","responseHeaders","$280a3f96dcc2704b$var$Event","_listeners","_scopes","_toRemove","_insideRaiseEvent","$280a3f96dcc2704b$var$compareNumber","numberOfListeners","addEventListener","listener","scope","event","removeEventListener","listeners","scopes","raiseEvent","apply","toRemove","$3fa9322de64db78e$var$Heap","_comparator","_array","_length","_maximumLength","$3fa9322de64db78e$var$swap","internalArray","maximumLength","originalLength","reserve","heapify","candidate","inserting","resort","ceil","insert","removedElement","parent","$22996820477a6820$var$statistics","numberOfAttemptedRequests","numberOfActiveRequests","numberOfCancelledRequests","numberOfCancelledActiveRequests","numberOfFailedRequests","numberOfActiveRequestsEver","lastNumberOfActiveRequests","$22996820477a6820$var$priorityHeapLength","$22996820477a6820$var$requestHeap","$22996820477a6820$var$activeRequests","$22996820477a6820$var$numberOfActiveRequestsByServer","$22996820477a6820$var$pageUri","$22996820477a6820$var$requestCompletedEvent","$22996820477a6820$var$RequestScheduler","$22996820477a6820$var$updatePriority","request","$22996820477a6820$var$issueRequest","$22996820477a6820$var$startRequest","then","results","catch","$22996820477a6820$var$cancelRequest","active","maximumRequests","maximumRequestsPerServer","requestsByServer","throttleRequests","debugShowStatistics","requestCompletedEvent","statistics","priorityHeapLength","serverHasOpenSlots","desiredRequests","maxRequests","heapHasOpenSlots","removeCount","activeLength","issuedRequests","issuedLength","openSlots","filledSlots","console","log","getServerKey","removedRequest","clearForSpecs","numberOfActiveRequestsByServer","requestHeap","$501f833019c34c9b$var$TrustedServers","$501f833019c34c9b$var$_servers","remove","contains","$501f833019c34c9b$var$getAuthority","clear","$b1dcbeb8d31d71ff$var$xhrBlobSupported","xhr","XMLHttpRequest","open","responseType","$b1dcbeb8d31d71ff$var$Resource","_url","_templateValues","$b1dcbeb8d31d71ff$var$defaultClone","templateValues","_queryParameters","queryParameters","proxy","retryCallback","retryAttempts","_retryCount","parseUrl","_credits","credits","defaultValue","$b1dcbeb8d31d71ff$var$combineQueryParameters","q1","q2","preserveQueryParameters","param","q2Value","$b1dcbeb8d31d71ff$var$fetchImage","flipY","skipColorSpaceConversion","preferImageBitmap","crossOrigin","isDataUri","isBlobUri","isCrossOriginUrl","_Implementations","createImage","retryOnError","retry","$b1dcbeb8d31d71ff$var$checkAndResetRequest","createIfNeeded","getDerivedResource","supportsImageBitmapOptions","createImageBitmap","fetchBlob","blob","all","imageOrientation","premultiplyAlpha","colorSpaceConversion","imageBitmaps","colorWithOptions","colorWithDefaults","isBlobSupported","getUrlComponent","extension","hasHeaders","merge","preserveQuery","baseUrl","$b1dcbeb8d31d71ff$var$stringifyQuery","queryObject","replacement","getURL","setQueryParameters","params","useAsDefault","appendQueryParameters","setTemplateValues","template","that","getBaseUri","appendForwardSlash","fetchArrayBuffer","fetch","fetchImage","useImageBitmap","generatedBlobResource","generatedBlob","preferBlob","blobPromise","supportsImageBitmap","createImageBitmapFromBlob","URL","createObjectURL","revokeObjectURL","fetchText","fetchJson","Accept","JSON","fetchXML","overrideMimeType","fetchJsonp","callbackParameterName","functionName","nextRandomNumber","$b1dcbeb8d31d71ff$var$fetchJsonp","callbackQuery","loadAndExecuteScript","_makeRequest","method","loadWithXhr","abort","$b1dcbeb8d31d71ff$var$dataUriRegex","$b1dcbeb8d31d71ff$var$decodeDataUriText","isBase64","atob","$b1dcbeb8d31d71ff$var$decodeDataUriArrayBuffer","byteString","ArrayBuffer","view","post","put","patch","loadImageElement","Image","naturalWidth","naturalHeight","xhrDeferred","$b1dcbeb8d31d71ff$var$noXMLHttpRequest","$c1eef27c4238262a$var$EarthOrientationParameters","_dates","_samples","_dateColumn","_xPoleWanderRadiansColumn","_yPoleWanderRadiansColumn","_ut1MinusUtcSecondsColumn","_xCelestialPoleOffsetRadiansColumn","_yCelestialPoleOffsetRadiansColumn","_taiMinusUtcSecondsColumn","_columnCount","_lastIndex","_addNewLeapSeconds","addNewLeapSeconds","$c1eef27c4238262a$var$onDataReady","columnNames","samples","$c1eef27c4238262a$var$compareLeapSecondDates","eop","eopData","lastTaiMinusUtc","dateColumn","xPoleWanderRadiansColumn","yPoleWanderRadiansColumn","ut1MinusUtcSecondsColumn","xCelestialPoleOffsetRadiansColumn","yCelestialPoleOffsetRadiansColumn","taiMinusUtcSecondsColumn","dates","mjd","taiMinusUtc","leapSecondIndex","$c1eef27c4238262a$var$fillResultFromIndex","columnCount","$c1eef27c4238262a$var$interpolate","before","after","y1","beforeDate","afterDate","factor","startBefore","startAfter","beforeUt1MinusUtc","afterUt1MinusUtc","offsetDifference","beforeTaiMinusUtc","afterTaiMinusUtc","dataUriRegexResult","$b1dcbeb8d31d71ff$var$decodeDataUri","mimeType","Blob","parser","DOMParser","parseFromString","$b1dcbeb8d31d71ff$var$loadWithHttpRequest","ok","forEach","status","json","arrayBuffer","withCredentials","setRequestHeader","localFile","getAllResponseHeaders","browserResponseType","splitHeaders","responseHeaderString","line","responseXML","hasChildNodes","responseText","send","_DefaultImplementations","DEFAULT","fromUrl","NONE","compute","previousIndexDate","nextIndexDate","isAfterPrevious","isAfterLastSample","isBeforeNext","$79e069d5452f6556$var$HeadingPitchRoll","denominatorRoll","numeratorRoll","denominatorHeading","numeratorHeading","asinClamped","RADIANS_PER_DEGREE","$b73be531cd978718$import_meta","assign","$b73be531cd978718$var$cesiumScriptRegex","$b73be531cd978718$var$tryMakeAbsolute","$b73be531cd978718$var$getCesiumBaseUrl","baseUrlString","CESIUM_BASE_URL","toUrlUndefined","$b73be531cd978718$var$buildModuleUrl","$b73be531cd978718$var$getBaseUrlFromCesiumScript","scripts","getAttribute","$b73be531cd978718$var$buildModuleUrlFromRequireToUrl","moduleID","$b73be531cd978718$var$buildModuleUrlFromBaseUrl","relativeUrl","_cesiumScriptRegex","_buildModuleUrlFromBaseUrl","_clearBaseResource","setBaseUrl","getCesiumBaseUrl","$c9c1200a42974c2d$export$2e2bcd8739ae039","$7212c54286490aec$var$Iau2006XysData","_xysFileUrlTemplate","xysFileUrlTemplate","_interpolationOrder","interpolationOrder","_sampleZeroJulianEphemerisDate","sampleZeroJulianEphemerisDate","_sampleZeroDateTT","_stepSizeDays","stepSizeDays","_samplesPerXysFile","samplesPerXysFile","_totalSamples","totalSamples","_chunkDownloadsInProgress","order","denom","_denominators","xTable","_xTable","stepN","pow","_work","_coef","$7212c54286490aec$var$julianDateScratch","$7212c54286490aec$var$getDaysSinceEpoch","xys","dayTT","secondTT","dateTT","$7212c54286490aec$var$requestXysChunk","xysData","chunkIndex","chunkUrl","chunk","newSamples","preload","startDayTT","startSecondTT","stopDayTT","stopSecondTT","startDaysSinceEpoch","stopDaysSinceEpoch","stopIndex","startChunk","stopChunk","promises","computeXysRadians","daysSinceEpoch","centerIndex","degree","firstIndex","isDataMissing","work","coef","sampleIndex","$19a47bf34378ad7c$var$_names","requestFullscreen","exitFullscreen","fullscreenEnabled","fullscreenElement","fullscreenchange","fullscreenerror","$19a47bf34378ad7c$var$Fullscreen","$da149e13e9eaa5f6$var$extractVersion","versionString","parseInt","$da149e13e9eaa5f6$var$isChrome","$da149e13e9eaa5f6$var$isEdge","fields","userAgent","$da149e13e9eaa5f6$var$isSafari","$da149e13e9eaa5f6$var$isWebkit","isNightly","$da149e13e9eaa5f6$var$isInternetExplorer","appName","$da149e13e9eaa5f6$var$isFirefox","$da149e13e9eaa5f6$var$supportsImageRenderingPixelated","imageRendering","$da149e13e9eaa5f6$var$supportsWebP","initialized","_result","supportsFullscreen","changeEventName","errorEventName","enabled","fullscreen","body","prefixes","prefix","vrDevice","vrDisplay","_names","navigator","_promise","initialize","$da149e13e9eaa5f6$var$typedArrayTypes","Int8Array","Int16Array","Uint16Array","Int32Array","Float64Array","Uint8ClampedArray","BigInt64Array","BigUint64Array","$da149e13e9eaa5f6$var$FeatureDetection","isChrome","chromeVersion","isSafari","safariVersion","isWebkit","webkitVersion","isInternetExplorer","internetExplorerVersion","isEdge","edgeVersion","isFirefox","firefoxVersion","isWindows","appVersion","isIPadOrIOS","platform","hardwareConcurrency","supportsPointerEvents","PointerEvent","pointerEnabled","supportsImageRenderingPixelated","supportsWebP","imageRenderingValue","typedArrayTypes","supportsBasis","scene","supportsWebAssembly","context","supportsTypedArrays","supportsBigInt64Array","supportsBigUint64Array","supportsBigInt","BigInt","supportsWebWorkers","Worker","WebAssembly","supportsWebgl2","webgl2","supportsEsmWebWorkers","$cd53d4b312c9644c$var$Quaternion","$cd53d4b312c9644c$var$fromAxisAngleScratch","fromAxisAngle","axis","halfAngle","$cd53d4b312c9644c$var$fromRotationMatrixNext","$cd53d4b312c9644c$var$fromRotationMatrixQuat","fromRotationMatrix","trace","next","quat","$cd53d4b312c9644c$var$scratchHPRQuaternion","$cd53d4b312c9644c$var$scratchHeadingQuaternion","$cd53d4b312c9644c$var$scratchPitchQuaternion","$cd53d4b312c9644c$var$scratchRollQuaternion","$cd53d4b312c9644c$var$sampledQuaternionAxis","$cd53d4b312c9644c$var$sampledQuaternionRotation","$cd53d4b312c9644c$var$sampledQuaternionTempQuaternion","$cd53d4b312c9644c$var$sampledQuaternionQuaternion0","$cd53d4b312c9644c$var$sampledQuaternionQuaternion0Conjugate","packedInterpolationLength","convertPackedArrayForInterpolation","packedArray","conjugate","computeAxis","computeAngle","unpackInterpolationResult","sourceArray","inverseMagnitude","leftX","leftY","leftZ","leftW","rightX","rightY","rightZ","rightW","EPSILON6","acos","$cd53d4b312c9644c$var$lerpScratch","$cd53d4b312c9644c$var$slerpEndNegated","$cd53d4b312c9644c$var$slerpScaledP","$cd53d4b312c9644c$var$slerpScaledR","slerp","theta","acosClamped","thetaOverSinTheta","exp","sinThetaOverTheta","$cd53d4b312c9644c$var$squadScratchCartesian0","$cd53d4b312c9644c$var$squadScratchCartesian1","$cd53d4b312c9644c$var$squadScratchQuaternion0","$cd53d4b312c9644c$var$squadScratchQuaternion1","computeInnerQuadrangle","q0","qInv","cart0","cart1","squad","s0","s1","slerp0","slerp1","$cd53d4b312c9644c$var$fastSlerpScratchQuaternion","$cd53d4b312c9644c$var$u","$cd53d4b312c9644c$var$v","$cd53d4b312c9644c$var$bT","$cd53d4b312c9644c$var$bD","$cd53d4b312c9644c$var$opmu","fastSlerp","xm1","sqrT","sqrD","cT","cD","fastSquad","$128fc127c88fc802$var$Transforms","$128fc127c88fc802$var$vectorProductLocalFrame","down","$128fc127c88fc802$var$degeneratePositionLocalFrame","$128fc127c88fc802$var$localFrameToFixedFrameCache","$128fc127c88fc802$var$scratchCalculateCartesian","$128fc127c88fc802$var$scratchFirstCartesian","$128fc127c88fc802$var$scratchSecondCartesian","$128fc127c88fc802$var$scratchThirdCartesian","localFrameToFixedFrameGenerator","firstAxis","secondAxis","resultat","thirdAxis","hashAxis","eastNorthUpToFixedFrame","northEastDownToFixedFrame","northUpEastToFixedFrame","northWestUpToFixedFrame","$128fc127c88fc802$var$scratchHPRQuaternion","$128fc127c88fc802$var$scratchScale","$128fc127c88fc802$var$scratchHPRMatrix4","headingPitchRollToFixedFrame","fixedFrameTransform","hprQuaternion","hprMatrix","$128fc127c88fc802$var$scratchENUMatrix4","$128fc127c88fc802$var$scratchHPRMatrix3","headingPitchRollQuaternion","transform","$128fc127c88fc802$var$noScale","$128fc127c88fc802$var$hprCenterScratch","$128fc127c88fc802$var$ffScratch","$128fc127c88fc802$var$hprTransformScratch","$128fc127c88fc802$var$hprRotationScratch","$128fc127c88fc802$var$hprQuaternionScratch","fixedFrameToHeadingPitchRoll","center","toFixedFrame","transformCopy","quaternionRotation","$128fc127c88fc802$var$twoPiOverSecondsInDay","$128fc127c88fc802$var$dateInUtc","computeIcrfToCentralBodyFixedMatrix","transformMatrix","computeIcrfToFixedMatrix","computeTemeToPseudoFixedMatrix","utcDayNumber","utcSecondsIntoDay","diffDays","gha","$128fc127c88fc802$var$gmstConstant0","$128fc127c88fc802$var$gmstConstant1","$128fc127c88fc802$var$gmstConstant2","$128fc127c88fc802$var$wgs84WRPrecessing","$128fc127c88fc802$var$rateCoef","cosGha","sinGha","iau2006XysData","earthOrientationParameters","preloadIcrfFixed","timeInterval","stop","fixedToIcrfMtx","computeFixedToIcrfMatrix","$128fc127c88fc802$var$scratchHpr","$128fc127c88fc802$var$scratchRotationMatrix","$128fc127c88fc802$var$dateScratch","computeMoonFixedToIcrfMatrix","secondsTT","e1","e2","e3","e4","e5","computeIcrfToMoonFixedMatrix","$128fc127c88fc802$var$xysScratch","$128fc127c88fc802$var$eopScratch","$128fc127c88fc802$var$rotation1Scratch","$128fc127c88fc802$var$rotation2Scratch","rotation1","rotation2","matrixQ","dateUt1day","fractionOfDay","dateUt1sec","era","daysSinceJ2000","earthRotation","pfToIcrf","cosxp","cosyp","sinxp","sinyp","ttt","sp","cossp","sinsp","fToPfMtx","$128fc127c88fc802$var$pointToWindowCoordinatesTemp","pointToWindowCoordinates","modelViewProjectionMatrix","viewportTransformation","point","pointToGLWindowCoordinates","fromCartesian4","$128fc127c88fc802$var$normalScratch","$128fc127c88fc802$var$rightScratch","$128fc127c88fc802$var$upScratch","rotationMatrixFromPositionVelocity","velocity","normal","$128fc127c88fc802$var$swizzleMatrix","$128fc127c88fc802$var$scratchCartographic","$128fc127c88fc802$var$scratchCartesian3Projection","$128fc127c88fc802$var$scratchCenter","$128fc127c88fc802$var$scratchRotation","$128fc127c88fc802$var$scratchFromENU","$128fc127c88fc802$var$scratchToENU","basisTo2D","projection","projectedPosition","rtcCenter","project","fromENU","toENU","local","ellipsoidTo2DModelMatrix","$0ad68ca5cf1aea2c$var$vectorScratch","$0ad68ca5cf1aea2c$var$windowPositionScratch","$0ad68ca5cf1aea2c$var$clickLocationScratch","$0ad68ca5cf1aea2c$var$centerScratch","$0ad68ca5cf1aea2c$var$oldTransformScratch","$0ad68ca5cf1aea2c$var$newTransformScratch","$0ad68ca5cf1aea2c$var$pickRayScratch","$0ad68ca5cf1aea2c$var$outerRingSvg","svg","$0ad68ca5cf1aea2c$var$innerRingSvg","$0ad68ca5cf1aea2c$var$rotationMarkerSvg","$0ad68ca5cf1aea2c$var$CesiumCompass","LitElement","clock","ready","orbitCursorAngle","orbitCursorOpacity","resetSpeed","styles","css","rotateClick","unlistenFromPostRender","unlistenFromClockTick","handleRotatePointerMoveFunction","handleRotatePointerMove","bind","handleRotatePointerUpFunction","handleRotatePointerUp","handleOrbitPointerMoveFunction","handleOrbitPointerMove","handleOrbitPointerUpFunction","handleOrbitPointerUp","handleOrbitTickFunction","handleOrbitTick","updated","postRender","outerRingStyle","rotationMarkerStyle","opacity","disconnectedCallback","handlePointerDown","compassElement","currentTarget","compassRectangle","getBoundingClientRect","compassCenter","clientX","clientY","distanceFromCenter","clientWidth","clientHeight","ray","getPickRay","viewCenter","globe","pick","frame","positionWC","distanceFraction","$0ad68ca5cf1aea2c$var$nominalGyroRadius","orbit","rotate","stopPropagation","preventDefault","cursorVector","rotateInitialCursorAngle","oldTransform","lookAtTransform","rotateInitialCameraAngle","moveUpIfTooCloseToTerrain","angleDifference","newCameraAngle","zeroToTwoPi","currentCameraAngle","rotateRight","resetToNorth","negativePiToPi","PI_OVER_TWO","duration","prevProgress","performance","step","elapsed","progress","rotateLeft","requestAnimationFrame","orbitIsLook","orbitLastTimestamp","onTick","updateAngleAndOpacity","timestamp","deltaT","look","rotateUp","distanceToTerrain","getHeight","positionCartographic","controller","screenSpaceCameraController","enableCollisionDetection","distanceDiff","minimumZoomDistance","moveUp","compassWidth","html","customElements","important","importantFlag","styleMap","directive","Directive","partInfo","super","PartType","ATTRIBUTE","styleInfo","prop","this","_previousStyleProperties","isImportant","CHILD","PROPERTY","BOOLEAN_ATTRIBUTE","EVENT","ELEMENT","_partInfo","_$isConnected","_$parent","_$initialize","attributeIndex","__part","__attributeIndex","_$resolve","props"],"version":3,"file":"cesium-compass.007a20e1.js.map"}
\ No newline at end of file
diff --git a/cesium-compass.007a20e1.js b/cesium-compass.f610fb3a.js
similarity index 99%
rename from cesium-compass.007a20e1.js
rename to cesium-compass.f610fb3a.js
index 43a703a..69b18ac 100644
--- a/cesium-compass.007a20e1.js
+++ b/cesium-compass.f610fb3a.js
@@ -9,6 +9,10 @@ ${this.stack.toString()}`),e},eT.packedLength=16,eT.pack=function(e,t,r){return(
(${this[1]}, ${this[5]}, ${this[9]}, ${this[13]})
(${this[2]}, ${this[6]}, ${this[10]}, ${this[14]})
(${this[3]}, ${this[7]}, ${this[11]}, ${this[15]})`};var eH=z("9btZb"),D=z("kWQjc"),F=z("bXwZF"),L=z("3pzcG"),B=z("8w8ZH"),$=z("jQJji"),H=z("1vHsR"),L=z("3pzcG"),eW=function(e,t,r){let n,a;(0,L.default).defined("array",e),(0,L.default).defined("itemToFind",t),(0,L.default).defined("comparator",r);let o=0,i=e.length-1;for(;o<=i;){if((a=r(e[n=~~((o+i)/2)],t))<0){o=n+1;continue}if(a>0){i=n-1;continue}return n}return~(i+1)},L=z("3pzcG"),B=z("8w8ZH"),$=z("jQJji"),eZ=function(e,t,r,n,a){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=r,this.yPoleOffset=n,this.ut1MinusUtc=a},B=z("8w8ZH"),$=z("jQJji"),H=z("1vHsR"),L=z("3pzcG"),B=z("8w8ZH"),H=(z("1vHsR"),z("1vHsR")),eJ=function(e){if(null===e||isNaN(e))throw new H.default("year is required and must be a number.");return e%4==0&&e%100!=0||e%400==0};const eY=[31,28,31,30,31,30,31,31,30,31,30,31];var eV=function(e,t,r,n,a,o,i,u){e=(0,B.default)(e,1),t=(0,B.default)(t,1),r=(0,B.default)(r,1),n=(0,B.default)(n,0),a=(0,B.default)(a,0),o=(0,B.default)(o,0),i=(0,B.default)(i,0),u=(0,B.default)(u,!1),(0,L.default).typeOf.number.greaterThanOrEquals("Year",e,1),(0,L.default).typeOf.number.lessThanOrEquals("Year",e,9999),(0,L.default).typeOf.number.greaterThanOrEquals("Month",t,1),(0,L.default).typeOf.number.lessThanOrEquals("Month",t,12),(0,L.default).typeOf.number.greaterThanOrEquals("Day",r,1),(0,L.default).typeOf.number.lessThanOrEquals("Day",r,31),(0,L.default).typeOf.number.greaterThanOrEquals("Hour",n,0),(0,L.default).typeOf.number.lessThanOrEquals("Hour",n,23),(0,L.default).typeOf.number.greaterThanOrEquals("Minute",a,0),(0,L.default).typeOf.number.lessThanOrEquals("Minute",a,59),(0,L.default).typeOf.bool("IsLeapSecond",u),(0,L.default).typeOf.number.greaterThanOrEquals("Second",o,0),(0,L.default).typeOf.number.lessThanOrEquals("Second",o,u?60:59),(0,L.default).typeOf.number.greaterThanOrEquals("Millisecond",i,0),(0,L.default).typeOf.number.lessThan("Millisecond",i,1e3),function(){let n=2===t&&eJ(e)?eY[t-1]+1:eY[t-1];if(r>n)throw new H.default("Month and Day represents invalid date")}(),this.year=e,this.month=t,this.day=r,this.hour=n,this.minute=a,this.second=o,this.millisecond=i,this.isLeapSecond=u},eX=function(e,t){this.julianDate=e,this.offset=t},eG=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}),eK=Object.freeze({UTC:0,TAI:1});const e0=new eV,e1=[31,28,31,30,31,30,31,31,30,31,30,31];function e2(e,t){return ts.compare(e.julianDate,t.julianDate)}const e3=new eX;function e4(e){e3.julianDate=e;let t=ts.leapSeconds,r=eW(t,e3,e2);r<0&&(r=~r),r>=t.length&&(r=t.length-1);let n=t[r].offset;r>0&&ts.secondsDifference(t[r].julianDate,e)>n&&(n=t[--r].offset),ts.addSeconds(e,n,e)}function e5(e,t){e3.julianDate=e;let r=ts.leapSeconds,n=eW(r,e3,e2);if(n<0&&(n=~n),0===n)return ts.addSeconds(e,-r[0].offset,t);if(n>=r.length)return ts.addSeconds(e,-r[n-1].offset,t);let a=ts.secondsDifference(r[n].julianDate,e);return 0===a?ts.addSeconds(e,-r[n].offset,t):a<=1?void 0:ts.addSeconds(e,-r[--n].offset,t)}function e6(e,t,r){let n=t/eG.SECONDS_PER_DAY|0;return e+=n,(t-=eG.SECONDS_PER_DAY*n)<0&&(e--,t+=eG.SECONDS_PER_DAY),r.dayNumber=e,r.secondsOfDay=t,r}function e8(e,t,r,n,a,o,i){let u=(t-14)/12|0,s=e+4800+u,l=(1461*s/4|0)+(367*(t-2-12*u)/12|0)-(3*((s+100)/100|0)/4|0)+r-32075;(n-=12)<0&&(n+=24);let f=o+(n*eG.SECONDS_PER_HOUR+a*eG.SECONDS_PER_MINUTE+i*eG.SECONDS_PER_MILLISECOND);return f>=43200&&(l-=1),[l,f]}const e7=/^(\d{4})$/,e9=/^(\d{4})-(\d{2})$/,te=/^(\d{4})-?(\d{3})$/,tt=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,tr=/^(\d{4})-?(\d{2})-?(\d{2})$/,tn=/([Z+\-])?(\d{2})?:?(\d{2})?$/,ta=/^(\d{2})(\.\d+)?/.source+tn.source,to=/^(\d{2}):?(\d{2})(\.\d+)?/.source+tn.source,ti=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+tn.source,tu="Invalid ISO 8601 date.";function ts(e,t,r){this.dayNumber=void 0,this.secondsOfDay=void 0,e=(0,B.default)(e,0),t=(0,B.default)(t,0),r=(0,B.default)(r,eK.UTC);let n=0|e;t+=(e-n)*eG.SECONDS_PER_DAY,e6(n,t,this),r===eK.UTC&&e4(this)}ts.fromGregorianDate=function(e,t){if(!(e instanceof eV))throw new H.default("date must be a valid GregorianDate.");let r=e8(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond);return(0,$.default)(t)?(e6(r[0],r[1],t),e4(t),t):new ts(r[0],r[1],eK.UTC)},ts.fromDate=function(e,t){if(!(e instanceof Date)||isNaN(e.getTime()))throw new H.default("date must be a valid JavaScript Date.");let r=e8(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return(0,$.default)(t)?(e6(r[0],r[1],t),e4(t),t):new ts(r[0],r[1],eK.UTC)},ts.fromIso8601=function(e,t){let r,n,a,o,i;if("string"!=typeof e)throw new H.default(tu);let u=(e=e.replace(",",".")).split("T"),s=1,l=1,f=0,d=0,c=0,p=0,h=u[0],m=u[1];if(!(0,$.default)(h))throw new H.default(tu);if(null!==(u=h.match(tr))){if((o=h.split("-").length-1)>0&&2!==o)throw new H.default(tu);r=+u[1],s=+u[2],l=+u[3]}else if(null!==(u=h.match(e9)))r=+u[1],s=+u[2];else if(null!==(u=h.match(e7)))r=+u[1];else{let e;if(null!==(u=h.match(te))){if(r=+u[1],e=+u[2],a=eJ(r),e<1||a&&e>366||!a&&e>365)throw new H.default(tu)}else if(null!==(u=h.match(tt))){r=+u[1];let t=+u[2],n=+u[3]||0;if((o=h.split("-").length-1)>0&&(!(0,$.default)(u[3])&&1!==o||(0,$.default)(u[3])&&2!==o))throw new H.default(tu);e=7*t+n-new Date(Date.UTC(r,0,4)).getUTCDay()-3}else throw new H.default(tu);(n=new Date(Date.UTC(r,0,1))).setUTCDate(e),s=n.getUTCMonth()+1,l=n.getUTCDate()}if(a=eJ(r),s<1||s>12||l<1||(2!==s||!a)&&l>e1[s-1]||a&&2===s&&l>29)throw new H.default(tu);if((0,$.default)(m)){if(null!==(u=m.match(ti))){if((o=m.split(":").length-1)>0&&2!==o&&3!==o)throw new H.default(tu);f=+u[1],d=+u[2],c=+u[3],p=1e3*+(u[4]||0),i=5}else if(null!==(u=m.match(to))){if((o=m.split(":").length-1)>2)throw new H.default(tu);f=+u[1],d=+u[2],c=60*+(u[3]||0),i=4}else if(null!==(u=m.match(ta)))f=+u[1],d=60*+(u[2]||0),i=3;else throw new H.default(tu);if(d>=60||c>=61||f>24||24===f&&(d>0||c>0||p>0))throw new H.default(tu);let e=u[i],t=+u[i+1],n=+(u[i+2]||0);switch(e){case"+":f-=t,d-=n;break;case"-":f+=t,d+=n;break;case"Z":break;default:d+=new Date(Date.UTC(r,s-1,l,f,d)).getTimezoneOffset()}}let y=60===c;for(y&&c--;d>=60;)d-=60,f++;for(;f>=24;)f-=24,l++;for(n=a&&2===s?29:e1[s-1];l>n;)l-=n,++s>12&&(s-=12,r++),n=a&&2===s?29:e1[s-1];for(;d<0;)d+=60,f--;for(;f<0;)f+=24,l--;for(;l<1;)--s<1&&(s+=12,r--),l+=n=a&&2===s?29:e1[s-1];let g=e8(r,s,l,f,d,c,p);return(0,$.default)(t)?(e6(g[0],g[1],t),e4(t)):t=new ts(g[0],g[1],eK.UTC),y&&ts.addSeconds(t,1,t),t},ts.now=function(e){return ts.fromDate(new Date,e)};const tl=new ts(0,0,eK.TAI);ts.toGregorianDate=function(e,t){if(!(0,$.default)(e))throw new H.default("julianDate is required.");let r=!1,n=e5(e,tl);(0,$.default)(n)||(ts.addSeconds(e,-1,tl),n=e5(tl,tl),r=!0);let a=n.dayNumber,o=n.secondsOfDay;o>=43200&&(a+=1);let i=a+68569|0,u=4*i/146097|0,s=4e3*((i=i-((146097*u+3)/4|0)|0)+1)/1461001|0,l=80*(i=i-(1461*s/4|0)+31|0)/2447|0,f=i-(2447*l/80|0)|0;i=l/11|0;let d=l+2-12*i|0,c=100*(u-49)+s+i|0,p=o/eG.SECONDS_PER_HOUR|0,h=o-p*eG.SECONDS_PER_HOUR,m=h/eG.SECONDS_PER_MINUTE|0,y=0|(h-=m*eG.SECONDS_PER_MINUTE),g=(h-y)/eG.SECONDS_PER_MILLISECOND;return((p+=12)>23&&(p-=24),r&&(y+=1),(0,$.default)(t))?(t.year=c,t.month=d,t.day=f,t.hour=p,t.minute=m,t.second=y,t.millisecond=g,t.isLeapSecond=r,t):new eV(c,d,f,p,m,y,g,r)},ts.toDate=function(e){if(!(0,$.default)(e))throw new H.default("julianDate is required.");let t=ts.toGregorianDate(e,e0),r=t.second;return t.isLeapSecond&&(r-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,r,t.millisecond))},ts.toIso8601=function(e,t){let r;if(!(0,$.default)(e))throw new H.default("julianDate is required.");let n=ts.toGregorianDate(e,e0),a=n.year,o=n.month,i=n.day,u=n.hour,s=n.minute,l=n.second,f=n.millisecond;return(1e4===a&&1===o&&1===i&&0===u&&0===s&&0===l&&0===f&&(a=9999,o=12,i=31,u=24),(0,$.default)(t)||0===f)?(0,$.default)(t)&&0!==t?(r=(.01*f).toFixed(t).replace(".","").slice(0,t),`${a.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${i.toString().padStart(2,"0")}T${u.toString().padStart(2,"0")}:${s.toString().padStart(2,"0")}:${l.toString().padStart(2,"0")}.${r}Z`):`${a.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${i.toString().padStart(2,"0")}T${u.toString().padStart(2,"0")}:${s.toString().padStart(2,"0")}:${l.toString().padStart(2,"0")}Z`:(r=(.01*f).toString().replace(".",""),`${a.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${i.toString().padStart(2,"0")}T${u.toString().padStart(2,"0")}:${s.toString().padStart(2,"0")}:${l.toString().padStart(2,"0")}.${r}Z`)},ts.clone=function(e,t){if((0,$.default)(e))return(0,$.default)(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new ts(e.dayNumber,e.secondsOfDay,eK.TAI)},ts.compare=function(e,t){if(!(0,$.default)(e))throw new H.default("left is required.");if(!(0,$.default)(t))throw new H.default("right is required.");let r=e.dayNumber-t.dayNumber;return 0!==r?r:e.secondsOfDay-t.secondsOfDay},ts.equals=function(e,t){return e===t||(0,$.default)(e)&&(0,$.default)(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},ts.equalsEpsilon=function(e,t,r){return r=(0,B.default)(r,0),e===t||(0,$.default)(e)&&(0,$.default)(t)&&Math.abs(ts.secondsDifference(e,t))<=r},ts.totalDays=function(e){if(!(0,$.default)(e))throw new H.default("julianDate is required.");return e.dayNumber+e.secondsOfDay/eG.SECONDS_PER_DAY},ts.secondsDifference=function(e,t){if(!(0,$.default)(e))throw new H.default("left is required.");if(!(0,$.default)(t))throw new H.default("right is required.");return(e.dayNumber-t.dayNumber)*eG.SECONDS_PER_DAY+(e.secondsOfDay-t.secondsOfDay)},ts.daysDifference=function(e,t){if(!(0,$.default)(e))throw new H.default("left is required.");if(!(0,$.default)(t))throw new H.default("right is required.");return e.dayNumber-t.dayNumber+(e.secondsOfDay-t.secondsOfDay)/eG.SECONDS_PER_DAY},ts.computeTaiMinusUtc=function(e){e3.julianDate=e;let t=ts.leapSeconds,r=eW(t,e3,e2);return r<0&&(r=~r,--r<0&&(r=0)),t[r].offset},ts.addSeconds=function(e,t,r){if(!(0,$.default)(e))throw new H.default("julianDate is required.");if(!(0,$.default)(t))throw new H.default("seconds is required.");if(!(0,$.default)(r))throw new H.default("result is required.");return e6(e.dayNumber,e.secondsOfDay+t,r)},ts.addMinutes=function(e,t,r){if(!(0,$.default)(e))throw new H.default("julianDate is required.");if(!(0,$.default)(t))throw new H.default("minutes is required.");if(!(0,$.default)(r))throw new H.default("result is required.");let n=e.secondsOfDay+t*eG.SECONDS_PER_MINUTE;return e6(e.dayNumber,n,r)},ts.addHours=function(e,t,r){if(!(0,$.default)(e))throw new H.default("julianDate is required.");if(!(0,$.default)(t))throw new H.default("hours is required.");if(!(0,$.default)(r))throw new H.default("result is required.");let n=e.secondsOfDay+t*eG.SECONDS_PER_HOUR;return e6(e.dayNumber,n,r)},ts.addDays=function(e,t,r){if(!(0,$.default)(e))throw new H.default("julianDate is required.");if(!(0,$.default)(t))throw new H.default("days is required.");if(!(0,$.default)(r))throw new H.default("result is required.");return e6(e.dayNumber+t,e.secondsOfDay,r)},ts.lessThan=function(e,t){return 0>ts.compare(e,t)},ts.lessThanOrEquals=function(e,t){return 0>=ts.compare(e,t)},ts.greaterThan=function(e,t){return ts.compare(e,t)>0},ts.greaterThanOrEquals=function(e,t){return ts.compare(e,t)>=0},ts.prototype.clone=function(e){return ts.clone(this,e)},ts.prototype.equals=function(e){return ts.equals(this,e)},ts.prototype.equalsEpsilon=function(e,t){return ts.equalsEpsilon(this,e,t)},ts.prototype.toString=function(){return ts.toIso8601(this)},ts.leapSeconds=[new eX(new ts(2441317,43210,eK.TAI),10),new eX(new ts(2441499,43211,eK.TAI),11),new eX(new ts(2441683,43212,eK.TAI),12),new eX(new ts(2442048,43213,eK.TAI),13),new eX(new ts(2442413,43214,eK.TAI),14),new eX(new ts(2442778,43215,eK.TAI),15),new eX(new ts(2443144,43216,eK.TAI),16),new eX(new ts(2443509,43217,eK.TAI),17),new eX(new ts(2443874,43218,eK.TAI),18),new eX(new ts(2444239,43219,eK.TAI),19),new eX(new ts(2444786,43220,eK.TAI),20),new eX(new ts(2445151,43221,eK.TAI),21),new eX(new ts(2445516,43222,eK.TAI),22),new eX(new ts(2446247,43223,eK.TAI),23),new eX(new ts(2447161,43224,eK.TAI),24),new eX(new ts(2447892,43225,eK.TAI),25),new eX(new ts(2448257,43226,eK.TAI),26),new eX(new ts(2448804,43227,eK.TAI),27),new eX(new ts(2449169,43228,eK.TAI),28),new eX(new ts(2449534,43229,eK.TAI),29),new eX(new ts(2450083,43230,eK.TAI),30),new eX(new ts(2450630,43231,eK.TAI),31),new eX(new ts(2451179,43232,eK.TAI),32),new eX(new ts(2453736,43233,eK.TAI),33),new eX(new ts(2454832,43234,eK.TAI),34),new eX(new ts(2456109,43235,eK.TAI),35),new eX(new ts(2457204,43236,eK.TAI),36),new eX(new ts(2457754,43237,eK.TAI),37)];var tf={};j=tf,A=function(e,t,r,n){var a,o=n&&n.URI;function i(e,t){var r=arguments.length>=1,n=arguments.length>=2;if(!(this instanceof i))return r?n?new i(e,t):new i(e):new i;if(void 0===e){if(r)throw TypeError("undefined is not a valid argument for URI");"undefined"!=typeof location?e=location.href+"":e=""}if(null===e&&r)throw TypeError("null is not a valid argument for URI");return(this.href(e),void 0!==t)?this.absoluteTo(t):this}i.version="1.19.11";var u=i.prototype,s=Object.prototype.hasOwnProperty;function l(e){return e.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function f(e){return void 0===e?"Undefined":String(Object.prototype.toString.call(e)).slice(8,-1)}function d(e){return"Array"===f(e)}function c(e,t){var r,n,a={};if("RegExp"===f(t))a=null;else if(d(t))for(r=0,n=t.length;rtrue
if they are equal, false
otherwise.\n *\n * @param {Cartographic} [left] The first cartographic.\n * @param {Cartographic} [right] The second cartographic.\n * @returns {boolean} true
if left and right are equal, false
otherwise.\n */ $69f9194a3ef67d4b$var$Cartographic.equals = function(left, right) {\n return left === right || (0, $jQJji.default)(left) && (0, $jQJji.default)(right) && left.longitude === right.longitude && left.latitude === right.latitude && left.height === right.height;\n};\n/**\n * Compares the provided cartographics componentwise and returns\n * true
if they are within the provided epsilon,\n * false
otherwise.\n *\n * @param {Cartographic} [left] The first cartographic.\n * @param {Cartographic} [right] The second cartographic.\n * @param {number} [epsilon=0] The epsilon to use for equality testing.\n * @returns {boolean} true
if left and right are within the provided epsilon, false
otherwise.\n */ $69f9194a3ef67d4b$var$Cartographic.equalsEpsilon = function(left, right, epsilon) {\n epsilon = (0, $8w8ZH.default)(epsilon, 0);\n return left === right || (0, $jQJji.default)(left) && (0, $jQJji.default)(right) && Math.abs(left.longitude - right.longitude) <= epsilon && Math.abs(left.latitude - right.latitude) <= epsilon && Math.abs(left.height - right.height) <= epsilon;\n};\n/**\n * An immutable Cartographic instance initialized to (0.0, 0.0, 0.0).\n *\n * @type {Cartographic}\n * @constant\n */ $69f9194a3ef67d4b$var$Cartographic.ZERO = Object.freeze(new $69f9194a3ef67d4b$var$Cartographic(0.0, 0.0, 0.0));\n/**\n * Duplicates this instance.\n *\n * @param {Cartographic} [result] The object onto which to store the result.\n * @returns {Cartographic} The modified result parameter or a new Cartographic instance if one was not provided.\n */ $69f9194a3ef67d4b$var$Cartographic.prototype.clone = function(result) {\n return $69f9194a3ef67d4b$var$Cartographic.clone(this, result);\n};\n/**\n * Compares the provided against this cartographic componentwise and returns\n * true
if they are equal, false
otherwise.\n *\n * @param {Cartographic} [right] The second cartographic.\n * @returns {boolean} true
if left and right are equal, false
otherwise.\n */ $69f9194a3ef67d4b$var$Cartographic.prototype.equals = function(right) {\n return $69f9194a3ef67d4b$var$Cartographic.equals(this, right);\n};\n/**\n * Compares the provided against this cartographic componentwise and returns\n * true
if they are within the provided epsilon,\n * false
otherwise.\n *\n * @param {Cartographic} [right] The second cartographic.\n * @param {number} [epsilon=0] The epsilon to use for equality testing.\n * @returns {boolean} true
if left and right are within the provided epsilon, false
otherwise.\n */ $69f9194a3ef67d4b$var$Cartographic.prototype.equalsEpsilon = function(right, epsilon) {\n return $69f9194a3ef67d4b$var$Cartographic.equalsEpsilon(this, right, epsilon);\n};\n/**\n * Creates a string representing this cartographic in the format '(longitude, latitude, height)'.\n *\n * @returns {string} A string representing the provided cartographic in the format '(longitude, latitude, height)'.\n */ $69f9194a3ef67d4b$var$Cartographic.prototype.toString = function() {\n return `(${this.longitude}, ${this.latitude}, ${this.height})`;\n};\nvar $69f9194a3ef67d4b$export$2e2bcd8739ae039 = $69f9194a3ef67d4b$var$Cartographic;\n\n\n\nvar $3pzcG = parcelRequire(\"3pzcG\");\n\nvar $8w8ZH = parcelRequire(\"8w8ZH\");\n\nvar $jQJji = parcelRequire(\"jQJji\");\n\nvar $1vHsR = parcelRequire(\"1vHsR\");\n\nvar $AXvpI = parcelRequire(\"AXvpI\");\n\nfunction $5237444a2d786ec9$var$initialize(ellipsoid, x, y, z) {\n x = (0, $8w8ZH.default)(x, 0.0);\n y = (0, $8w8ZH.default)(y, 0.0);\n z = (0, $8w8ZH.default)(z, 0.0);\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.number.greaterThanOrEquals(\"x\", x, 0.0);\n (0, $3pzcG.default).typeOf.number.greaterThanOrEquals(\"y\", y, 0.0);\n (0, $3pzcG.default).typeOf.number.greaterThanOrEquals(\"z\", z, 0.0);\n //>>includeEnd('debug');\n ellipsoid._radii = new (0, $bXwZF.default)(x, y, z);\n ellipsoid._radiiSquared = new (0, $bXwZF.default)(x * x, y * y, z * z);\n ellipsoid._radiiToTheFourth = new (0, $bXwZF.default)(x * x * x * x, y * y * y * y, z * z * z * z);\n ellipsoid._oneOverRadii = new (0, $bXwZF.default)(x === 0.0 ? 0.0 : 1.0 / x, y === 0.0 ? 0.0 : 1.0 / y, z === 0.0 ? 0.0 : 1.0 / z);\n ellipsoid._oneOverRadiiSquared = new (0, $bXwZF.default)(x === 0.0 ? 0.0 : 1.0 / (x * x), y === 0.0 ? 0.0 : 1.0 / (y * y), z === 0.0 ? 0.0 : 1.0 / (z * z));\n ellipsoid._minimumRadius = Math.min(x, y, z);\n ellipsoid._maximumRadius = Math.max(x, y, z);\n ellipsoid._centerToleranceSquared = (0, $AXvpI.default).EPSILON1;\n if (ellipsoid._radiiSquared.z !== 0) ellipsoid._squaredXOverSquaredZ = ellipsoid._radiiSquared.x / ellipsoid._radiiSquared.z;\n}\n/**\n * A quadratic surface defined in Cartesian coordinates by the equation\n * (x / a)^2 + (y / b)^2 + (z / c)^2 = 1
. Primarily used\n * by Cesium to represent the shape of planetary bodies.\n *\n * Rather than constructing this object directly, one of the provided\n * constants is normally used.\n * @alias Ellipsoid\n * @constructor\n *\n * @param {number} [x=0] The radius in the x direction.\n * @param {number} [y=0] The radius in the y direction.\n * @param {number} [z=0] The radius in the z direction.\n *\n * @exception {DeveloperError} All radii components must be greater than or equal to zero.\n *\n * @see Ellipsoid.fromCartesian3\n * @see Ellipsoid.WGS84\n * @see Ellipsoid.UNIT_SPHERE\n */ function $5237444a2d786ec9$var$Ellipsoid(x, y, z) {\n this._radii = undefined;\n this._radiiSquared = undefined;\n this._radiiToTheFourth = undefined;\n this._oneOverRadii = undefined;\n this._oneOverRadiiSquared = undefined;\n this._minimumRadius = undefined;\n this._maximumRadius = undefined;\n this._centerToleranceSquared = undefined;\n this._squaredXOverSquaredZ = undefined;\n $5237444a2d786ec9$var$initialize(this, x, y, z);\n}\nObject.defineProperties($5237444a2d786ec9$var$Ellipsoid.prototype, {\n /**\n * Gets the radii of the ellipsoid.\n * @memberof Ellipsoid.prototype\n * @type {Cartesian3}\n * @readonly\n */ radii: {\n get: function() {\n return this._radii;\n }\n },\n /**\n * Gets the squared radii of the ellipsoid.\n * @memberof Ellipsoid.prototype\n * @type {Cartesian3}\n * @readonly\n */ radiiSquared: {\n get: function() {\n return this._radiiSquared;\n }\n },\n /**\n * Gets the radii of the ellipsoid raise to the fourth power.\n * @memberof Ellipsoid.prototype\n * @type {Cartesian3}\n * @readonly\n */ radiiToTheFourth: {\n get: function() {\n return this._radiiToTheFourth;\n }\n },\n /**\n * Gets one over the radii of the ellipsoid.\n * @memberof Ellipsoid.prototype\n * @type {Cartesian3}\n * @readonly\n */ oneOverRadii: {\n get: function() {\n return this._oneOverRadii;\n }\n },\n /**\n * Gets one over the squared radii of the ellipsoid.\n * @memberof Ellipsoid.prototype\n * @type {Cartesian3}\n * @readonly\n */ oneOverRadiiSquared: {\n get: function() {\n return this._oneOverRadiiSquared;\n }\n },\n /**\n * Gets the minimum radius of the ellipsoid.\n * @memberof Ellipsoid.prototype\n * @type {number}\n * @readonly\n */ minimumRadius: {\n get: function() {\n return this._minimumRadius;\n }\n },\n /**\n * Gets the maximum radius of the ellipsoid.\n * @memberof Ellipsoid.prototype\n * @type {number}\n * @readonly\n */ maximumRadius: {\n get: function() {\n return this._maximumRadius;\n }\n }\n});\n/**\n * Duplicates an Ellipsoid instance.\n *\n * @param {Ellipsoid} ellipsoid The ellipsoid to duplicate.\n * @param {Ellipsoid} [result] The object onto which to store the result, or undefined if a new\n * instance should be created.\n * @returns {Ellipsoid} The cloned Ellipsoid. (Returns undefined if ellipsoid is undefined)\n */ $5237444a2d786ec9$var$Ellipsoid.clone = function(ellipsoid, result) {\n if (!(0, $jQJji.default)(ellipsoid)) return undefined;\n const radii = ellipsoid._radii;\n if (!(0, $jQJji.default)(result)) return new $5237444a2d786ec9$var$Ellipsoid(radii.x, radii.y, radii.z);\n (0, $bXwZF.default).clone(radii, result._radii);\n (0, $bXwZF.default).clone(ellipsoid._radiiSquared, result._radiiSquared);\n (0, $bXwZF.default).clone(ellipsoid._radiiToTheFourth, result._radiiToTheFourth);\n (0, $bXwZF.default).clone(ellipsoid._oneOverRadii, result._oneOverRadii);\n (0, $bXwZF.default).clone(ellipsoid._oneOverRadiiSquared, result._oneOverRadiiSquared);\n result._minimumRadius = ellipsoid._minimumRadius;\n result._maximumRadius = ellipsoid._maximumRadius;\n result._centerToleranceSquared = ellipsoid._centerToleranceSquared;\n return result;\n};\n/**\n * Computes an Ellipsoid from a Cartesian specifying the radii in x, y, and z directions.\n *\n * @param {Cartesian3} [cartesian=Cartesian3.ZERO] The ellipsoid's radius in the x, y, and z directions.\n * @param {Ellipsoid} [result] The object onto which to store the result, or undefined if a new\n * instance should be created.\n * @returns {Ellipsoid} A new Ellipsoid instance.\n *\n * @exception {DeveloperError} All radii components must be greater than or equal to zero.\n *\n * @see Ellipsoid.WGS84\n * @see Ellipsoid.UNIT_SPHERE\n */ $5237444a2d786ec9$var$Ellipsoid.fromCartesian3 = function(cartesian, result) {\n if (!(0, $jQJji.default)(result)) result = new $5237444a2d786ec9$var$Ellipsoid();\n if (!(0, $jQJji.default)(cartesian)) return result;\n $5237444a2d786ec9$var$initialize(result, cartesian.x, cartesian.y, cartesian.z);\n return result;\n};\n/**\n * An Ellipsoid instance initialized to the WGS84 standard.\n *\n * @type {Ellipsoid}\n * @constant\n */ $5237444a2d786ec9$var$Ellipsoid.WGS84 = Object.freeze(new $5237444a2d786ec9$var$Ellipsoid(6378137.0, 6378137.0, 6356752.3142451793));\n/**\n * An Ellipsoid instance initialized to radii of (1.0, 1.0, 1.0).\n *\n * @type {Ellipsoid}\n * @constant\n */ $5237444a2d786ec9$var$Ellipsoid.UNIT_SPHERE = Object.freeze(new $5237444a2d786ec9$var$Ellipsoid(1.0, 1.0, 1.0));\n/**\n * An Ellipsoid instance initialized to a sphere with the lunar radius.\n *\n * @type {Ellipsoid}\n * @constant\n */ $5237444a2d786ec9$var$Ellipsoid.MOON = Object.freeze(new $5237444a2d786ec9$var$Ellipsoid((0, $AXvpI.default).LUNAR_RADIUS, (0, $AXvpI.default).LUNAR_RADIUS, (0, $AXvpI.default).LUNAR_RADIUS));\n$5237444a2d786ec9$var$Ellipsoid._default = $5237444a2d786ec9$var$Ellipsoid.WGS84;\nObject.defineProperties($5237444a2d786ec9$var$Ellipsoid, {\n /**\n * The default ellipsoid used when not otherwise specified.\n * @memberof Ellipsoid\n * @type {Ellipsoid}\n * @example\n * Cesium.Ellipsoid.default = Cesium.Ellipsoid.MOON;\n *\n * // Apollo 11 landing site\n * const position = Cesium.Cartesian3.fromRadians(\n * 0.67416,\n * 23.47315,\n * );\n */ default: {\n get: function() {\n return $5237444a2d786ec9$var$Ellipsoid._default;\n },\n set: function(value) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.object(\"value\", value);\n //>>includeEnd('debug');\n $5237444a2d786ec9$var$Ellipsoid._default = value;\n (0, $bXwZF.default)._ellipsoidRadiiSquared = value.radiiSquared;\n (0, $69f9194a3ef67d4b$export$2e2bcd8739ae039)._ellipsoidOneOverRadii = value.oneOverRadii;\n (0, $69f9194a3ef67d4b$export$2e2bcd8739ae039)._ellipsoidOneOverRadiiSquared = value.oneOverRadiiSquared;\n (0, $69f9194a3ef67d4b$export$2e2bcd8739ae039)._ellipsoidCenterToleranceSquared = value._centerToleranceSquared;\n }\n }\n});\n/**\n * Duplicates an Ellipsoid instance.\n *\n * @param {Ellipsoid} [result] The object onto which to store the result, or undefined if a new\n * instance should be created.\n * @returns {Ellipsoid} The cloned Ellipsoid.\n */ $5237444a2d786ec9$var$Ellipsoid.prototype.clone = function(result) {\n return $5237444a2d786ec9$var$Ellipsoid.clone(this, result);\n};\n/**\n * The number of elements used to pack the object into an array.\n * @type {number}\n */ $5237444a2d786ec9$var$Ellipsoid.packedLength = (0, $bXwZF.default).packedLength;\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {Ellipsoid} value The value to pack.\n * @param {number[]} array The array to pack into.\n * @param {number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {number[]} The array that was packed into\n */ $5237444a2d786ec9$var$Ellipsoid.pack = function(value, array, startingIndex) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.object(\"value\", value);\n (0, $3pzcG.default).defined(\"array\", array);\n //>>includeEnd('debug');\n startingIndex = (0, $8w8ZH.default)(startingIndex, 0);\n (0, $bXwZF.default).pack(value._radii, array, startingIndex);\n return array;\n};\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {number[]} array The packed array.\n * @param {number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {Ellipsoid} [result] The object into which to store the result.\n * @returns {Ellipsoid} The modified result parameter or a new Ellipsoid instance if one was not provided.\n */ $5237444a2d786ec9$var$Ellipsoid.unpack = function(array, startingIndex, result) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).defined(\"array\", array);\n //>>includeEnd('debug');\n startingIndex = (0, $8w8ZH.default)(startingIndex, 0);\n const radii = (0, $bXwZF.default).unpack(array, startingIndex);\n return $5237444a2d786ec9$var$Ellipsoid.fromCartesian3(radii, result);\n};\n/**\n * Computes the unit vector directed from the center of this ellipsoid toward the provided Cartesian position.\n * @function\n *\n * @param {Cartesian3} cartesian The Cartesian for which to to determine the geocentric normal.\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if none was provided.\n */ $5237444a2d786ec9$var$Ellipsoid.prototype.geocentricSurfaceNormal = (0, $bXwZF.default).normalize;\n/**\n * Computes the normal of the plane tangent to the surface of the ellipsoid at the provided position.\n *\n * @param {Cartographic} cartographic The cartographic position for which to to determine the geodetic normal.\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if none was provided.\n */ $5237444a2d786ec9$var$Ellipsoid.prototype.geodeticSurfaceNormalCartographic = function(cartographic, result) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.object(\"cartographic\", cartographic);\n //>>includeEnd('debug');\n const longitude = cartographic.longitude;\n const latitude = cartographic.latitude;\n const cosLatitude = Math.cos(latitude);\n const x = cosLatitude * Math.cos(longitude);\n const y = cosLatitude * Math.sin(longitude);\n const z = Math.sin(latitude);\n if (!(0, $jQJji.default)(result)) result = new (0, $bXwZF.default)();\n result.x = x;\n result.y = y;\n result.z = z;\n return (0, $bXwZF.default).normalize(result, result);\n};\n/**\n * Computes the normal of the plane tangent to the surface of the ellipsoid at the provided position.\n *\n * @param {Cartesian3} cartesian The Cartesian position for which to to determine the surface normal.\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if none was provided, or undefined if a normal cannot be found.\n */ $5237444a2d786ec9$var$Ellipsoid.prototype.geodeticSurfaceNormal = function(cartesian, result) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.object(\"cartesian\", cartesian);\n if (isNaN(cartesian.x) || isNaN(cartesian.y) || isNaN(cartesian.z)) throw new (0, $1vHsR.default)(\"cartesian has a NaN component\");\n //>>includeEnd('debug');\n if ((0, $bXwZF.default).equalsEpsilon(cartesian, (0, $bXwZF.default).ZERO, (0, $AXvpI.default).EPSILON14)) return undefined;\n if (!(0, $jQJji.default)(result)) result = new (0, $bXwZF.default)();\n result = (0, $bXwZF.default).multiplyComponents(cartesian, this._oneOverRadiiSquared, result);\n return (0, $bXwZF.default).normalize(result, result);\n};\nconst $5237444a2d786ec9$var$cartographicToCartesianNormal = new (0, $bXwZF.default)();\nconst $5237444a2d786ec9$var$cartographicToCartesianK = new (0, $bXwZF.default)();\n/**\n * Converts the provided cartographic to Cartesian representation.\n *\n * @param {Cartographic} cartographic The cartographic position.\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if none was provided.\n *\n * @example\n * //Create a Cartographic and determine it's Cartesian representation on a WGS84 ellipsoid.\n * const position = new Cesium.Cartographic(Cesium.Math.toRadians(21), Cesium.Math.toRadians(78), 5000);\n * const cartesianPosition = Cesium.Ellipsoid.WGS84.cartographicToCartesian(position);\n */ $5237444a2d786ec9$var$Ellipsoid.prototype.cartographicToCartesian = function(cartographic, result) {\n //`cartographic is required` is thrown from geodeticSurfaceNormalCartographic.\n const n = $5237444a2d786ec9$var$cartographicToCartesianNormal;\n const k = $5237444a2d786ec9$var$cartographicToCartesianK;\n this.geodeticSurfaceNormalCartographic(cartographic, n);\n (0, $bXwZF.default).multiplyComponents(this._radiiSquared, n, k);\n const gamma = Math.sqrt((0, $bXwZF.default).dot(n, k));\n (0, $bXwZF.default).divideByScalar(k, gamma, k);\n (0, $bXwZF.default).multiplyByScalar(n, cartographic.height, n);\n if (!(0, $jQJji.default)(result)) result = new (0, $bXwZF.default)();\n return (0, $bXwZF.default).add(k, n, result);\n};\n/**\n * Converts the provided array of cartographics to an array of Cartesians.\n *\n * @param {Cartographic[]} cartographics An array of cartographic positions.\n * @param {Cartesian3[]} [result] The object onto which to store the result.\n * @returns {Cartesian3[]} The modified result parameter or a new Array instance if none was provided.\n *\n * @example\n * //Convert an array of Cartographics and determine their Cartesian representation on a WGS84 ellipsoid.\n * const positions = [new Cesium.Cartographic(Cesium.Math.toRadians(21), Cesium.Math.toRadians(78), 0),\n * new Cesium.Cartographic(Cesium.Math.toRadians(21.321), Cesium.Math.toRadians(78.123), 100),\n * new Cesium.Cartographic(Cesium.Math.toRadians(21.645), Cesium.Math.toRadians(78.456), 250)];\n * const cartesianPositions = Cesium.Ellipsoid.WGS84.cartographicArrayToCartesianArray(positions);\n */ $5237444a2d786ec9$var$Ellipsoid.prototype.cartographicArrayToCartesianArray = function(cartographics, result) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).defined(\"cartographics\", cartographics);\n //>>includeEnd('debug')\n const length = cartographics.length;\n if (!(0, $jQJji.default)(result)) result = new Array(length);\n else result.length = length;\n for(let i = 0; i < length; i++)result[i] = this.cartographicToCartesian(cartographics[i], result[i]);\n return result;\n};\nconst $5237444a2d786ec9$var$cartesianToCartographicN = new (0, $bXwZF.default)();\nconst $5237444a2d786ec9$var$cartesianToCartographicP = new (0, $bXwZF.default)();\nconst $5237444a2d786ec9$var$cartesianToCartographicH = new (0, $bXwZF.default)();\n/**\n * Converts the provided cartesian to cartographic representation.\n * The cartesian is undefined at the center of the ellipsoid.\n *\n * @param {Cartesian3} cartesian The Cartesian position to convert to cartographic representation.\n * @param {Cartographic} [result] The object onto which to store the result.\n * @returns {Cartographic} The modified result parameter, new Cartographic instance if none was provided, or undefined if the cartesian is at the center of the ellipsoid.\n *\n * @example\n * //Create a Cartesian and determine it's Cartographic representation on a WGS84 ellipsoid.\n * const position = new Cesium.Cartesian3(17832.12, 83234.52, 952313.73);\n * const cartographicPosition = Cesium.Ellipsoid.WGS84.cartesianToCartographic(position);\n */ $5237444a2d786ec9$var$Ellipsoid.prototype.cartesianToCartographic = function(cartesian, result) {\n //`cartesian is required.` is thrown from scaleToGeodeticSurface\n const p = this.scaleToGeodeticSurface(cartesian, $5237444a2d786ec9$var$cartesianToCartographicP);\n if (!(0, $jQJji.default)(p)) return undefined;\n const n = this.geodeticSurfaceNormal(p, $5237444a2d786ec9$var$cartesianToCartographicN);\n const h = (0, $bXwZF.default).subtract(cartesian, p, $5237444a2d786ec9$var$cartesianToCartographicH);\n const longitude = Math.atan2(n.y, n.x);\n const latitude = Math.asin(n.z);\n const height = (0, $AXvpI.default).sign((0, $bXwZF.default).dot(h, cartesian)) * (0, $bXwZF.default).magnitude(h);\n if (!(0, $jQJji.default)(result)) return new (0, $69f9194a3ef67d4b$export$2e2bcd8739ae039)(longitude, latitude, height);\n result.longitude = longitude;\n result.latitude = latitude;\n result.height = height;\n return result;\n};\n/**\n * Converts the provided array of cartesians to an array of cartographics.\n *\n * @param {Cartesian3[]} cartesians An array of Cartesian positions.\n * @param {Cartographic[]} [result] The object onto which to store the result.\n * @returns {Cartographic[]} The modified result parameter or a new Array instance if none was provided.\n *\n * @example\n * //Create an array of Cartesians and determine their Cartographic representation on a WGS84 ellipsoid.\n * const positions = [new Cesium.Cartesian3(17832.12, 83234.52, 952313.73),\n * new Cesium.Cartesian3(17832.13, 83234.53, 952313.73),\n * new Cesium.Cartesian3(17832.14, 83234.54, 952313.73)]\n * const cartographicPositions = Cesium.Ellipsoid.WGS84.cartesianArrayToCartographicArray(positions);\n */ $5237444a2d786ec9$var$Ellipsoid.prototype.cartesianArrayToCartographicArray = function(cartesians, result) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).defined(\"cartesians\", cartesians);\n //>>includeEnd('debug');\n const length = cartesians.length;\n if (!(0, $jQJji.default)(result)) result = new Array(length);\n else result.length = length;\n for(let i = 0; i < length; ++i)result[i] = this.cartesianToCartographic(cartesians[i], result[i]);\n return result;\n};\n/**\n * Scales the provided Cartesian position along the geodetic surface normal\n * so that it is on the surface of this ellipsoid. If the position is\n * at the center of the ellipsoid, this function returns undefined.\n *\n * @param {Cartesian3} cartesian The Cartesian position to scale.\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter, a new Cartesian3 instance if none was provided, or undefined if the position is at the center.\n */ $5237444a2d786ec9$var$Ellipsoid.prototype.scaleToGeodeticSurface = function(cartesian, result) {\n return (0, $667f84b0348f3801$export$2e2bcd8739ae039)(cartesian, this._oneOverRadii, this._oneOverRadiiSquared, this._centerToleranceSquared, result);\n};\n/**\n * Scales the provided Cartesian position along the geocentric surface normal\n * so that it is on the surface of this ellipsoid.\n *\n * @param {Cartesian3} cartesian The Cartesian position to scale.\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if none was provided.\n */ $5237444a2d786ec9$var$Ellipsoid.prototype.scaleToGeocentricSurface = function(cartesian, result) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.object(\"cartesian\", cartesian);\n //>>includeEnd('debug');\n if (!(0, $jQJji.default)(result)) result = new (0, $bXwZF.default)();\n const positionX = cartesian.x;\n const positionY = cartesian.y;\n const positionZ = cartesian.z;\n const oneOverRadiiSquared = this._oneOverRadiiSquared;\n const beta = 1.0 / Math.sqrt(positionX * positionX * oneOverRadiiSquared.x + positionY * positionY * oneOverRadiiSquared.y + positionZ * positionZ * oneOverRadiiSquared.z);\n return (0, $bXwZF.default).multiplyByScalar(cartesian, beta, result);\n};\n/**\n * Transforms a Cartesian X, Y, Z position to the ellipsoid-scaled space by multiplying\n * its components by the result of {@link Ellipsoid#oneOverRadii}.\n *\n * @param {Cartesian3} position The position to transform.\n * @param {Cartesian3} [result] The position to which to copy the result, or undefined to create and\n * return a new instance.\n * @returns {Cartesian3} The position expressed in the scaled space. The returned instance is the\n * one passed as the result parameter if it is not undefined, or a new instance of it is.\n */ $5237444a2d786ec9$var$Ellipsoid.prototype.transformPositionToScaledSpace = function(position, result) {\n if (!(0, $jQJji.default)(result)) result = new (0, $bXwZF.default)();\n return (0, $bXwZF.default).multiplyComponents(position, this._oneOverRadii, result);\n};\n/**\n * Transforms a Cartesian X, Y, Z position from the ellipsoid-scaled space by multiplying\n * its components by the result of {@link Ellipsoid#radii}.\n *\n * @param {Cartesian3} position The position to transform.\n * @param {Cartesian3} [result] The position to which to copy the result, or undefined to create and\n * return a new instance.\n * @returns {Cartesian3} The position expressed in the unscaled space. The returned instance is the\n * one passed as the result parameter if it is not undefined, or a new instance of it is.\n */ $5237444a2d786ec9$var$Ellipsoid.prototype.transformPositionFromScaledSpace = function(position, result) {\n if (!(0, $jQJji.default)(result)) result = new (0, $bXwZF.default)();\n return (0, $bXwZF.default).multiplyComponents(position, this._radii, result);\n};\n/**\n * Compares this Ellipsoid against the provided Ellipsoid componentwise and returns\n * true
if they are equal, false
otherwise.\n *\n * @param {Ellipsoid} [right] The other Ellipsoid.\n * @returns {boolean} true
if they are equal, false
otherwise.\n */ $5237444a2d786ec9$var$Ellipsoid.prototype.equals = function(right) {\n return this === right || (0, $jQJji.default)(right) && (0, $bXwZF.default).equals(this._radii, right._radii);\n};\n/**\n * Creates a string representing this Ellipsoid in the format '(radii.x, radii.y, radii.z)'.\n *\n * @returns {string} A string representing this ellipsoid in the format '(radii.x, radii.y, radii.z)'.\n */ $5237444a2d786ec9$var$Ellipsoid.prototype.toString = function() {\n return this._radii.toString();\n};\n/**\n * Computes a point which is the intersection of the surface normal with the z-axis.\n *\n * @param {Cartesian3} position the position. must be on the surface of the ellipsoid.\n * @param {number} [buffer = 0.0] A buffer to subtract from the ellipsoid size when checking if the point is inside the ellipsoid.\n * 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.\n * In WGS84 datum, intersection point is at max z = +-42841.31151331382 (0.673% of z-axis).\n * Intersection point could be outside the ellipsoid if the ratio of MajorAxis / AxisOfRotation is bigger than the square root of 2\n * @param {Cartesian3} [result] The cartesian to which to copy the result, or undefined to create and\n * return a new instance.\n * @returns {Cartesian3 | undefined} the intersection point if it's inside the ellipsoid, undefined otherwise\n *\n * @exception {DeveloperError} position is required.\n * @exception {DeveloperError} Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y).\n * @exception {DeveloperError} Ellipsoid.radii.z must be greater than 0.\n */ $5237444a2d786ec9$var$Ellipsoid.prototype.getSurfaceNormalIntersectionWithZAxis = function(position, buffer, result) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.object(\"position\", position);\n if (!(0, $AXvpI.default).equalsEpsilon(this._radii.x, this._radii.y, (0, $AXvpI.default).EPSILON15)) throw new (0, $1vHsR.default)(\"Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)\");\n (0, $3pzcG.default).typeOf.number.greaterThan(\"Ellipsoid.radii.z\", this._radii.z, 0);\n //>>includeEnd('debug');\n buffer = (0, $8w8ZH.default)(buffer, 0.0);\n const squaredXOverSquaredZ = this._squaredXOverSquaredZ;\n if (!(0, $jQJji.default)(result)) result = new (0, $bXwZF.default)();\n result.x = 0.0;\n result.y = 0.0;\n result.z = position.z * (1 - squaredXOverSquaredZ);\n if (Math.abs(result.z) >= this._radii.z - buffer) return undefined;\n return result;\n};\nconst $5237444a2d786ec9$var$scratchEndpoint = new (0, $bXwZF.default)();\n/**\n * Computes the ellipsoid curvatures at a given position on the surface.\n *\n * @param {Cartesian3} surfacePosition The position on the ellipsoid surface where curvatures will be calculated.\n * @param {Cartesian2} [result] The cartesian to which to copy the result, or undefined to create and return a new instance.\n * @returns {Cartesian2} The local curvature of the ellipsoid surface at the provided position, in east and north directions.\n *\n * @exception {DeveloperError} position is required.\n */ $5237444a2d786ec9$var$Ellipsoid.prototype.getLocalCurvature = function(surfacePosition, result) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.object(\"surfacePosition\", surfacePosition);\n //>>includeEnd('debug');\n if (!(0, $jQJji.default)(result)) result = new (0, $kWQjc.default)();\n const primeVerticalEndpoint = this.getSurfaceNormalIntersectionWithZAxis(surfacePosition, 0.0, $5237444a2d786ec9$var$scratchEndpoint);\n const primeVerticalRadius = (0, $bXwZF.default).distance(surfacePosition, primeVerticalEndpoint);\n // meridional radius = (1 - e^2) * primeVerticalRadius^3 / a^2\n // where 1 - e^2 = b^2 / a^2,\n // so meridional = b^2 * primeVerticalRadius^3 / a^4\n // = (b * primeVerticalRadius / a^2)^2 * primeVertical\n const radiusRatio = this.minimumRadius * primeVerticalRadius / this.maximumRadius ** 2;\n const meridionalRadius = primeVerticalRadius * radiusRatio ** 2;\n return (0, $kWQjc.default).fromElements(1.0 / primeVerticalRadius, 1.0 / meridionalRadius, result);\n};\nconst $5237444a2d786ec9$var$abscissas = [\n 0.14887433898163,\n 0.43339539412925,\n 0.67940956829902,\n 0.86506336668898,\n 0.97390652851717,\n 0.0\n];\nconst $5237444a2d786ec9$var$weights = [\n 0.29552422471475,\n 0.26926671930999,\n 0.21908636251598,\n 0.14945134915058,\n 0.066671344308684,\n 0.0\n];\n/**\n * Compute the 10th order Gauss-Legendre Quadrature of the given definite integral.\n *\n * @param {number} a The lower bound for the integration.\n * @param {number} b The upper bound for the integration.\n * @param {Ellipsoid~RealValuedScalarFunction} func The function to integrate.\n * @returns {number} The value of the integral of the given function over the given domain.\n *\n * @private\n */ function $5237444a2d786ec9$var$gaussLegendreQuadrature(a, b, func) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.number(\"a\", a);\n (0, $3pzcG.default).typeOf.number(\"b\", b);\n (0, $3pzcG.default).typeOf.func(\"func\", func);\n //>>includeEnd('debug');\n // The range is half of the normal range since the five weights add to one (ten weights add to two).\n // The values of the abscissas are multiplied by two to account for this.\n const xMean = 0.5 * (b + a);\n const xRange = 0.5 * (b - a);\n let sum = 0.0;\n for(let i = 0; i < 5; i++){\n const dx = xRange * $5237444a2d786ec9$var$abscissas[i];\n sum += $5237444a2d786ec9$var$weights[i] * (func(xMean + dx) + func(xMean - dx));\n }\n // Scale the sum to the range of x.\n sum *= xRange;\n return sum;\n}\n/**\n * A real valued scalar function.\n * @callback Ellipsoid~RealValuedScalarFunction\n *\n * @param {number} x The value used to evaluate the function.\n * @returns {number} The value of the function at x.\n *\n * @private\n */ /**\n * Computes an approximation of the surface area of a rectangle on the surface of an ellipsoid using\n * Gauss-Legendre 10th order quadrature.\n *\n * @param {Rectangle} rectangle The rectangle used for computing the surface area.\n * @returns {number} The approximate area of the rectangle on the surface of this ellipsoid.\n */ $5237444a2d786ec9$var$Ellipsoid.prototype.surfaceArea = function(rectangle) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.object(\"rectangle\", rectangle);\n //>>includeEnd('debug');\n const minLongitude = rectangle.west;\n let maxLongitude = rectangle.east;\n const minLatitude = rectangle.south;\n const maxLatitude = rectangle.north;\n while(maxLongitude < minLongitude)maxLongitude += (0, $AXvpI.default).TWO_PI;\n const radiiSquared = this._radiiSquared;\n const a2 = radiiSquared.x;\n const b2 = radiiSquared.y;\n const c2 = radiiSquared.z;\n const a2b2 = a2 * b2;\n return $5237444a2d786ec9$var$gaussLegendreQuadrature(minLatitude, maxLatitude, function(lat) {\n // phi represents the angle measured from the north pole\n // sin(phi) = sin(pi / 2 - lat) = cos(lat), cos(phi) is similar\n const sinPhi = Math.cos(lat);\n const cosPhi = Math.sin(lat);\n return Math.cos(lat) * $5237444a2d786ec9$var$gaussLegendreQuadrature(minLongitude, maxLongitude, function(lon) {\n const cosTheta = Math.cos(lon);\n const sinTheta = Math.sin(lon);\n return Math.sqrt(a2b2 * cosPhi * cosPhi + c2 * (b2 * cosTheta * cosTheta + a2 * sinTheta * sinTheta) * sinPhi * sinPhi);\n });\n });\n};\nvar $5237444a2d786ec9$export$2e2bcd8739ae039 = $5237444a2d786ec9$var$Ellipsoid;\n\n\nvar $AXvpI = parcelRequire(\"AXvpI\");\nvar $bXwZF = parcelRequire(\"bXwZF\");\n\nvar $3pzcG = parcelRequire(\"3pzcG\");\n\nvar $8w8ZH = parcelRequire(\"8w8ZH\");\n\nvar $jQJji = parcelRequire(\"jQJji\");\n\nvar $1vHsR = parcelRequire(\"1vHsR\");\n\nvar $AXvpI = parcelRequire(\"AXvpI\");\n/**\n * A 4D Cartesian point.\n * @alias Cartesian4\n * @constructor\n *\n * @param {number} [x=0.0] The X component.\n * @param {number} [y=0.0] The Y component.\n * @param {number} [z=0.0] The Z component.\n * @param {number} [w=0.0] The W component.\n *\n * @see Cartesian2\n * @see Cartesian3\n * @see Packable\n */ function $dba8420c01d8a224$var$Cartesian4(x, y, z, w) {\n /**\n * The X component.\n * @type {number}\n * @default 0.0\n */ this.x = (0, $8w8ZH.default)(x, 0.0);\n /**\n * The Y component.\n * @type {number}\n * @default 0.0\n */ this.y = (0, $8w8ZH.default)(y, 0.0);\n /**\n * The Z component.\n * @type {number}\n * @default 0.0\n */ this.z = (0, $8w8ZH.default)(z, 0.0);\n /**\n * The W component.\n * @type {number}\n * @default 0.0\n */ this.w = (0, $8w8ZH.default)(w, 0.0);\n}\n/**\n * Creates a Cartesian4 instance from x, y, z and w coordinates.\n *\n * @param {number} x The x coordinate.\n * @param {number} y The y coordinate.\n * @param {number} z The z coordinate.\n * @param {number} w The w coordinate.\n * @param {Cartesian4} [result] The object onto which to store the result.\n * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided.\n */ $dba8420c01d8a224$var$Cartesian4.fromElements = function(x, y, z, w, result) {\n if (!(0, $jQJji.default)(result)) return new $dba8420c01d8a224$var$Cartesian4(x, y, z, w);\n result.x = x;\n result.y = y;\n result.z = z;\n result.w = w;\n return result;\n};\n/**\n * Creates a Cartesian4 instance from a {@link Color}. red
, green
, blue
,\n * and alpha
map to x
, y
, z
, and w
, respectively.\n *\n * @param {Color} color The source color.\n * @param {Cartesian4} [result] The object onto which to store the result.\n * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided.\n */ $dba8420c01d8a224$var$Cartesian4.fromColor = function(color, result) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.object(\"color\", color);\n //>>includeEnd('debug');\n if (!(0, $jQJji.default)(result)) return new $dba8420c01d8a224$var$Cartesian4(color.red, color.green, color.blue, color.alpha);\n result.x = color.red;\n result.y = color.green;\n result.z = color.blue;\n result.w = color.alpha;\n return result;\n};\n/**\n * Duplicates a Cartesian4 instance.\n *\n * @param {Cartesian4} cartesian The Cartesian to duplicate.\n * @param {Cartesian4} [result] The object onto which to store the result.\n * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided. (Returns undefined if cartesian is undefined)\n */ $dba8420c01d8a224$var$Cartesian4.clone = function(cartesian, result) {\n if (!(0, $jQJji.default)(cartesian)) return undefined;\n if (!(0, $jQJji.default)(result)) return new $dba8420c01d8a224$var$Cartesian4(cartesian.x, cartesian.y, cartesian.z, cartesian.w);\n result.x = cartesian.x;\n result.y = cartesian.y;\n result.z = cartesian.z;\n result.w = cartesian.w;\n return result;\n};\n/**\n * The number of elements used to pack the object into an array.\n * @type {number}\n */ $dba8420c01d8a224$var$Cartesian4.packedLength = 4;\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {Cartesian4} value The value to pack.\n * @param {number[]} array The array to pack into.\n * @param {number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {number[]} The array that was packed into\n */ $dba8420c01d8a224$var$Cartesian4.pack = function(value, array, startingIndex) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.object(\"value\", value);\n (0, $3pzcG.default).defined(\"array\", array);\n //>>includeEnd('debug');\n startingIndex = (0, $8w8ZH.default)(startingIndex, 0);\n array[startingIndex++] = value.x;\n array[startingIndex++] = value.y;\n array[startingIndex++] = value.z;\n array[startingIndex] = value.w;\n return array;\n};\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {number[]} array The packed array.\n * @param {number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {Cartesian4} [result] The object into which to store the result.\n * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided.\n */ $dba8420c01d8a224$var$Cartesian4.unpack = function(array, startingIndex, result) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).defined(\"array\", array);\n //>>includeEnd('debug');\n startingIndex = (0, $8w8ZH.default)(startingIndex, 0);\n if (!(0, $jQJji.default)(result)) result = new $dba8420c01d8a224$var$Cartesian4();\n result.x = array[startingIndex++];\n result.y = array[startingIndex++];\n result.z = array[startingIndex++];\n result.w = array[startingIndex];\n return result;\n};\n/**\n * Flattens an array of Cartesian4s into an array of components.\n *\n * @param {Cartesian4[]} array The array of cartesians to pack.\n * @param {number[]} [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.\n * @returns {number[]} The packed array.\n */ $dba8420c01d8a224$var$Cartesian4.packArray = function(array, result) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).defined(\"array\", array);\n //>>includeEnd('debug');\n const length = array.length;\n const resultLength = length * 4;\n if (!(0, $jQJji.default)(result)) result = new Array(resultLength);\n else if (!Array.isArray(result) && result.length !== resultLength) //>>includeStart('debug', pragmas.debug);\n throw new (0, $1vHsR.default)(\"If result is a typed array, it must have exactly array.length * 4 elements\");\n else if (result.length !== resultLength) result.length = resultLength;\n for(let i = 0; i < length; ++i)$dba8420c01d8a224$var$Cartesian4.pack(array[i], result, i * 4);\n return result;\n};\n/**\n * Unpacks an array of cartesian components into an array of Cartesian4s.\n *\n * @param {number[]} array The array of components to unpack.\n * @param {Cartesian4[]} [result] The array onto which to store the result.\n * @returns {Cartesian4[]} The unpacked array.\n */ $dba8420c01d8a224$var$Cartesian4.unpackArray = function(array, result) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).defined(\"array\", array);\n (0, $3pzcG.default).typeOf.number.greaterThanOrEquals(\"array.length\", array.length, 4);\n if (array.length % 4 !== 0) throw new (0, $1vHsR.default)(\"array length must be a multiple of 4.\");\n //>>includeEnd('debug');\n const length = array.length;\n if (!(0, $jQJji.default)(result)) result = new Array(length / 4);\n else result.length = length / 4;\n for(let i = 0; i < length; i += 4){\n const index = i / 4;\n result[index] = $dba8420c01d8a224$var$Cartesian4.unpack(array, i, result[index]);\n }\n return result;\n};\n/**\n * Creates a Cartesian4 from four consecutive elements in an array.\n * @function\n *\n * @param {number[]} array The array whose four consecutive elements correspond to the x, y, z, and w components, respectively.\n * @param {number} [startingIndex=0] The offset into the array of the first element, which corresponds to the x component.\n * @param {Cartesian4} [result] The object onto which to store the result.\n * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided.\n *\n * @example\n * // Create a Cartesian4 with (1.0, 2.0, 3.0, 4.0)\n * const v = [1.0, 2.0, 3.0, 4.0];\n * const p = Cesium.Cartesian4.fromArray(v);\n *\n * // Create a Cartesian4 with (1.0, 2.0, 3.0, 4.0) using an offset into an array\n * const v2 = [0.0, 0.0, 1.0, 2.0, 3.0, 4.0];\n * const p2 = Cesium.Cartesian4.fromArray(v2, 2);\n */ $dba8420c01d8a224$var$Cartesian4.fromArray = $dba8420c01d8a224$var$Cartesian4.unpack;\n/**\n * Computes the value of the maximum component for the supplied Cartesian.\n *\n * @param {Cartesian4} cartesian The cartesian to use.\n * @returns {number} The value of the maximum component.\n */ $dba8420c01d8a224$var$Cartesian4.maximumComponent = function(cartesian) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.object(\"cartesian\", cartesian);\n //>>includeEnd('debug');\n return Math.max(cartesian.x, cartesian.y, cartesian.z, cartesian.w);\n};\n/**\n * Computes the value of the minimum component for the supplied Cartesian.\n *\n * @param {Cartesian4} cartesian The cartesian to use.\n * @returns {number} The value of the minimum component.\n */ $dba8420c01d8a224$var$Cartesian4.minimumComponent = function(cartesian) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.object(\"cartesian\", cartesian);\n //>>includeEnd('debug');\n return Math.min(cartesian.x, cartesian.y, cartesian.z, cartesian.w);\n};\n/**\n * Compares two Cartesians and computes a Cartesian which contains the minimum components of the supplied Cartesians.\n *\n * @param {Cartesian4} first A cartesian to compare.\n * @param {Cartesian4} second A cartesian to compare.\n * @param {Cartesian4} result The object into which to store the result.\n * @returns {Cartesian4} A cartesian with the minimum components.\n */ $dba8420c01d8a224$var$Cartesian4.minimumByComponent = function(first, second, result) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.object(\"first\", first);\n (0, $3pzcG.default).typeOf.object(\"second\", second);\n (0, $3pzcG.default).typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n result.x = Math.min(first.x, second.x);\n result.y = Math.min(first.y, second.y);\n result.z = Math.min(first.z, second.z);\n result.w = Math.min(first.w, second.w);\n return result;\n};\n/**\n * Compares two Cartesians and computes a Cartesian which contains the maximum components of the supplied Cartesians.\n *\n * @param {Cartesian4} first A cartesian to compare.\n * @param {Cartesian4} second A cartesian to compare.\n * @param {Cartesian4} result The object into which to store the result.\n * @returns {Cartesian4} A cartesian with the maximum components.\n */ $dba8420c01d8a224$var$Cartesian4.maximumByComponent = function(first, second, result) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.object(\"first\", first);\n (0, $3pzcG.default).typeOf.object(\"second\", second);\n (0, $3pzcG.default).typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n result.x = Math.max(first.x, second.x);\n result.y = Math.max(first.y, second.y);\n result.z = Math.max(first.z, second.z);\n result.w = Math.max(first.w, second.w);\n return result;\n};\n/**\n * Constrain a value to lie between two values.\n *\n * @param {Cartesian4} value The value to clamp.\n * @param {Cartesian4} min The minimum bound.\n * @param {Cartesian4} max The maximum bound.\n * @param {Cartesian4} result The object into which to store the result.\n * @returns {Cartesian4} The clamped value such that min <= result <= max.\n */ $dba8420c01d8a224$var$Cartesian4.clamp = function(value, min, max, result) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.object(\"value\", value);\n (0, $3pzcG.default).typeOf.object(\"min\", min);\n (0, $3pzcG.default).typeOf.object(\"max\", max);\n (0, $3pzcG.default).typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n const x = (0, $AXvpI.default).clamp(value.x, min.x, max.x);\n const y = (0, $AXvpI.default).clamp(value.y, min.y, max.y);\n const z = (0, $AXvpI.default).clamp(value.z, min.z, max.z);\n const w = (0, $AXvpI.default).clamp(value.w, min.w, max.w);\n result.x = x;\n result.y = y;\n result.z = z;\n result.w = w;\n return result;\n};\n/**\n * Computes the provided Cartesian's squared magnitude.\n *\n * @param {Cartesian4} cartesian The Cartesian instance whose squared magnitude is to be computed.\n * @returns {number} The squared magnitude.\n */ $dba8420c01d8a224$var$Cartesian4.magnitudeSquared = function(cartesian) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.object(\"cartesian\", cartesian);\n //>>includeEnd('debug');\n return cartesian.x * cartesian.x + cartesian.y * cartesian.y + cartesian.z * cartesian.z + cartesian.w * cartesian.w;\n};\n/**\n * Computes the Cartesian's magnitude (length).\n *\n * @param {Cartesian4} cartesian The Cartesian instance whose magnitude is to be computed.\n * @returns {number} The magnitude.\n */ $dba8420c01d8a224$var$Cartesian4.magnitude = function(cartesian) {\n return Math.sqrt($dba8420c01d8a224$var$Cartesian4.magnitudeSquared(cartesian));\n};\nconst $dba8420c01d8a224$var$distanceScratch = new $dba8420c01d8a224$var$Cartesian4();\n/**\n * Computes the 4-space distance between two points.\n *\n * @param {Cartesian4} left The first point to compute the distance from.\n * @param {Cartesian4} right The second point to compute the distance to.\n * @returns {number} The distance between two points.\n *\n * @example\n * // Returns 1.0\n * const d = Cesium.Cartesian4.distance(\n * new Cesium.Cartesian4(1.0, 0.0, 0.0, 0.0),\n * new Cesium.Cartesian4(2.0, 0.0, 0.0, 0.0));\n */ $dba8420c01d8a224$var$Cartesian4.distance = function(left, right) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.object(\"left\", left);\n (0, $3pzcG.default).typeOf.object(\"right\", right);\n //>>includeEnd('debug');\n $dba8420c01d8a224$var$Cartesian4.subtract(left, right, $dba8420c01d8a224$var$distanceScratch);\n return $dba8420c01d8a224$var$Cartesian4.magnitude($dba8420c01d8a224$var$distanceScratch);\n};\n/**\n * Computes the squared distance between two points. Comparing squared distances\n * using this function is more efficient than comparing distances using {@link Cartesian4#distance}.\n *\n * @param {Cartesian4} left The first point to compute the distance from.\n * @param {Cartesian4} right The second point to compute the distance to.\n * @returns {number} The distance between two points.\n *\n * @example\n * // Returns 4.0, not 2.0\n * const d = Cesium.Cartesian4.distance(\n * new Cesium.Cartesian4(1.0, 0.0, 0.0, 0.0),\n * new Cesium.Cartesian4(3.0, 0.0, 0.0, 0.0));\n */ $dba8420c01d8a224$var$Cartesian4.distanceSquared = function(left, right) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.object(\"left\", left);\n (0, $3pzcG.default).typeOf.object(\"right\", right);\n //>>includeEnd('debug');\n $dba8420c01d8a224$var$Cartesian4.subtract(left, right, $dba8420c01d8a224$var$distanceScratch);\n return $dba8420c01d8a224$var$Cartesian4.magnitudeSquared($dba8420c01d8a224$var$distanceScratch);\n};\n/**\n * Computes the normalized form of the supplied Cartesian.\n *\n * @param {Cartesian4} cartesian The Cartesian to be normalized.\n * @param {Cartesian4} result The object onto which to store the result.\n * @returns {Cartesian4} The modified result parameter.\n */ $dba8420c01d8a224$var$Cartesian4.normalize = function(cartesian, result) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.object(\"cartesian\", cartesian);\n (0, $3pzcG.default).typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n const magnitude = $dba8420c01d8a224$var$Cartesian4.magnitude(cartesian);\n result.x = cartesian.x / magnitude;\n result.y = cartesian.y / magnitude;\n result.z = cartesian.z / magnitude;\n result.w = cartesian.w / magnitude;\n //>>includeStart('debug', pragmas.debug);\n if (isNaN(result.x) || isNaN(result.y) || isNaN(result.z) || isNaN(result.w)) throw new (0, $1vHsR.default)(\"normalized result is not a number\");\n //>>includeEnd('debug');\n return result;\n};\n/**\n * Computes the dot (scalar) product of two Cartesians.\n *\n * @param {Cartesian4} left The first Cartesian.\n * @param {Cartesian4} right The second Cartesian.\n * @returns {number} The dot product.\n */ $dba8420c01d8a224$var$Cartesian4.dot = function(left, right) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.object(\"left\", left);\n (0, $3pzcG.default).typeOf.object(\"right\", right);\n //>>includeEnd('debug');\n return left.x * right.x + left.y * right.y + left.z * right.z + left.w * right.w;\n};\n/**\n * Computes the componentwise product of two Cartesians.\n *\n * @param {Cartesian4} left The first Cartesian.\n * @param {Cartesian4} right The second Cartesian.\n * @param {Cartesian4} result The object onto which to store the result.\n * @returns {Cartesian4} The modified result parameter.\n */ $dba8420c01d8a224$var$Cartesian4.multiplyComponents = function(left, right, result) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.object(\"left\", left);\n (0, $3pzcG.default).typeOf.object(\"right\", right);\n (0, $3pzcG.default).typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n result.x = left.x * right.x;\n result.y = left.y * right.y;\n result.z = left.z * right.z;\n result.w = left.w * right.w;\n return result;\n};\n/**\n * Computes the componentwise quotient of two Cartesians.\n *\n * @param {Cartesian4} left The first Cartesian.\n * @param {Cartesian4} right The second Cartesian.\n * @param {Cartesian4} result The object onto which to store the result.\n * @returns {Cartesian4} The modified result parameter.\n */ $dba8420c01d8a224$var$Cartesian4.divideComponents = function(left, right, result) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.object(\"left\", left);\n (0, $3pzcG.default).typeOf.object(\"right\", right);\n (0, $3pzcG.default).typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n result.x = left.x / right.x;\n result.y = left.y / right.y;\n result.z = left.z / right.z;\n result.w = left.w / right.w;\n return result;\n};\n/**\n * Computes the componentwise sum of two Cartesians.\n *\n * @param {Cartesian4} left The first Cartesian.\n * @param {Cartesian4} right The second Cartesian.\n * @param {Cartesian4} result The object onto which to store the result.\n * @returns {Cartesian4} The modified result parameter.\n */ $dba8420c01d8a224$var$Cartesian4.add = function(left, right, result) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.object(\"left\", left);\n (0, $3pzcG.default).typeOf.object(\"right\", right);\n (0, $3pzcG.default).typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n result.x = left.x + right.x;\n result.y = left.y + right.y;\n result.z = left.z + right.z;\n result.w = left.w + right.w;\n return result;\n};\n/**\n * Computes the componentwise difference of two Cartesians.\n *\n * @param {Cartesian4} left The first Cartesian.\n * @param {Cartesian4} right The second Cartesian.\n * @param {Cartesian4} result The object onto which to store the result.\n * @returns {Cartesian4} The modified result parameter.\n */ $dba8420c01d8a224$var$Cartesian4.subtract = function(left, right, result) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.object(\"left\", left);\n (0, $3pzcG.default).typeOf.object(\"right\", right);\n (0, $3pzcG.default).typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n result.x = left.x - right.x;\n result.y = left.y - right.y;\n result.z = left.z - right.z;\n result.w = left.w - right.w;\n return result;\n};\n/**\n * Multiplies the provided Cartesian componentwise by the provided scalar.\n *\n * @param {Cartesian4} cartesian The Cartesian to be scaled.\n * @param {number} scalar The scalar to multiply with.\n * @param {Cartesian4} result The object onto which to store the result.\n * @returns {Cartesian4} The modified result parameter.\n */ $dba8420c01d8a224$var$Cartesian4.multiplyByScalar = function(cartesian, scalar, result) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.object(\"cartesian\", cartesian);\n (0, $3pzcG.default).typeOf.number(\"scalar\", scalar);\n (0, $3pzcG.default).typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n result.x = cartesian.x * scalar;\n result.y = cartesian.y * scalar;\n result.z = cartesian.z * scalar;\n result.w = cartesian.w * scalar;\n return result;\n};\n/**\n * Divides the provided Cartesian componentwise by the provided scalar.\n *\n * @param {Cartesian4} cartesian The Cartesian to be divided.\n * @param {number} scalar The scalar to divide by.\n * @param {Cartesian4} result The object onto which to store the result.\n * @returns {Cartesian4} The modified result parameter.\n */ $dba8420c01d8a224$var$Cartesian4.divideByScalar = function(cartesian, scalar, result) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.object(\"cartesian\", cartesian);\n (0, $3pzcG.default).typeOf.number(\"scalar\", scalar);\n (0, $3pzcG.default).typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n result.x = cartesian.x / scalar;\n result.y = cartesian.y / scalar;\n result.z = cartesian.z / scalar;\n result.w = cartesian.w / scalar;\n return result;\n};\n/**\n * Negates the provided Cartesian.\n *\n * @param {Cartesian4} cartesian The Cartesian to be negated.\n * @param {Cartesian4} result The object onto which to store the result.\n * @returns {Cartesian4} The modified result parameter.\n */ $dba8420c01d8a224$var$Cartesian4.negate = function(cartesian, result) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.object(\"cartesian\", cartesian);\n (0, $3pzcG.default).typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n result.x = -cartesian.x;\n result.y = -cartesian.y;\n result.z = -cartesian.z;\n result.w = -cartesian.w;\n return result;\n};\n/**\n * Computes the absolute value of the provided Cartesian.\n *\n * @param {Cartesian4} cartesian The Cartesian whose absolute value is to be computed.\n * @param {Cartesian4} result The object onto which to store the result.\n * @returns {Cartesian4} The modified result parameter.\n */ $dba8420c01d8a224$var$Cartesian4.abs = function(cartesian, result) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.object(\"cartesian\", cartesian);\n (0, $3pzcG.default).typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n result.x = Math.abs(cartesian.x);\n result.y = Math.abs(cartesian.y);\n result.z = Math.abs(cartesian.z);\n result.w = Math.abs(cartesian.w);\n return result;\n};\nconst $dba8420c01d8a224$var$lerpScratch = new $dba8420c01d8a224$var$Cartesian4();\n/**\n * Computes the linear interpolation or extrapolation at t using the provided cartesians.\n *\n * @param {Cartesian4} start The value corresponding to t at 0.0.\n * @param {Cartesian4}end The value corresponding to t at 1.0.\n * @param {number} t The point along t at which to interpolate.\n * @param {Cartesian4} result The object onto which to store the result.\n * @returns {Cartesian4} The modified result parameter.\n */ $dba8420c01d8a224$var$Cartesian4.lerp = function(start, end, t, result) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.object(\"start\", start);\n (0, $3pzcG.default).typeOf.object(\"end\", end);\n (0, $3pzcG.default).typeOf.number(\"t\", t);\n (0, $3pzcG.default).typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n $dba8420c01d8a224$var$Cartesian4.multiplyByScalar(end, t, $dba8420c01d8a224$var$lerpScratch);\n result = $dba8420c01d8a224$var$Cartesian4.multiplyByScalar(start, 1.0 - t, result);\n return $dba8420c01d8a224$var$Cartesian4.add($dba8420c01d8a224$var$lerpScratch, result, result);\n};\nconst $dba8420c01d8a224$var$mostOrthogonalAxisScratch = new $dba8420c01d8a224$var$Cartesian4();\n/**\n * Returns the axis that is most orthogonal to the provided Cartesian.\n *\n * @param {Cartesian4} cartesian The Cartesian on which to find the most orthogonal axis.\n * @param {Cartesian4} result The object onto which to store the result.\n * @returns {Cartesian4} The most orthogonal axis.\n */ $dba8420c01d8a224$var$Cartesian4.mostOrthogonalAxis = function(cartesian, result) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.object(\"cartesian\", cartesian);\n (0, $3pzcG.default).typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n const f = $dba8420c01d8a224$var$Cartesian4.normalize(cartesian, $dba8420c01d8a224$var$mostOrthogonalAxisScratch);\n $dba8420c01d8a224$var$Cartesian4.abs(f, f);\n if (f.x <= f.y) {\n if (f.x <= f.z) {\n if (f.x <= f.w) result = $dba8420c01d8a224$var$Cartesian4.clone($dba8420c01d8a224$var$Cartesian4.UNIT_X, result);\n else result = $dba8420c01d8a224$var$Cartesian4.clone($dba8420c01d8a224$var$Cartesian4.UNIT_W, result);\n } else if (f.z <= f.w) result = $dba8420c01d8a224$var$Cartesian4.clone($dba8420c01d8a224$var$Cartesian4.UNIT_Z, result);\n else result = $dba8420c01d8a224$var$Cartesian4.clone($dba8420c01d8a224$var$Cartesian4.UNIT_W, result);\n } else if (f.y <= f.z) {\n if (f.y <= f.w) result = $dba8420c01d8a224$var$Cartesian4.clone($dba8420c01d8a224$var$Cartesian4.UNIT_Y, result);\n else result = $dba8420c01d8a224$var$Cartesian4.clone($dba8420c01d8a224$var$Cartesian4.UNIT_W, result);\n } else if (f.z <= f.w) result = $dba8420c01d8a224$var$Cartesian4.clone($dba8420c01d8a224$var$Cartesian4.UNIT_Z, result);\n else result = $dba8420c01d8a224$var$Cartesian4.clone($dba8420c01d8a224$var$Cartesian4.UNIT_W, result);\n return result;\n};\n/**\n * Compares the provided Cartesians componentwise and returns\n * true
if they are equal, false
otherwise.\n *\n * @param {Cartesian4} [left] The first Cartesian.\n * @param {Cartesian4} [right] The second Cartesian.\n * @returns {boolean} true
if left and right are equal, false
otherwise.\n */ $dba8420c01d8a224$var$Cartesian4.equals = function(left, right) {\n return left === right || (0, $jQJji.default)(left) && (0, $jQJji.default)(right) && left.x === right.x && left.y === right.y && left.z === right.z && left.w === right.w;\n};\n/**\n * @private\n */ $dba8420c01d8a224$var$Cartesian4.equalsArray = function(cartesian, array, offset) {\n return cartesian.x === array[offset] && cartesian.y === array[offset + 1] && cartesian.z === array[offset + 2] && cartesian.w === array[offset + 3];\n};\n/**\n * Compares the provided Cartesians componentwise and returns\n * true
if they pass an absolute or relative tolerance test,\n * false
otherwise.\n *\n * @param {Cartesian4} [left] The first Cartesian.\n * @param {Cartesian4} [right] The second Cartesian.\n * @param {number} [relativeEpsilon=0] The relative epsilon tolerance to use for equality testing.\n * @param {number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing.\n * @returns {boolean} true
if left and right are within the provided epsilon, false
otherwise.\n */ $dba8420c01d8a224$var$Cartesian4.equalsEpsilon = function(left, right, relativeEpsilon, absoluteEpsilon) {\n return left === right || (0, $jQJji.default)(left) && (0, $jQJji.default)(right) && (0, $AXvpI.default).equalsEpsilon(left.x, right.x, relativeEpsilon, absoluteEpsilon) && (0, $AXvpI.default).equalsEpsilon(left.y, right.y, relativeEpsilon, absoluteEpsilon) && (0, $AXvpI.default).equalsEpsilon(left.z, right.z, relativeEpsilon, absoluteEpsilon) && (0, $AXvpI.default).equalsEpsilon(left.w, right.w, relativeEpsilon, absoluteEpsilon);\n};\n/**\n * An immutable Cartesian4 instance initialized to (0.0, 0.0, 0.0, 0.0).\n *\n * @type {Cartesian4}\n * @constant\n */ $dba8420c01d8a224$var$Cartesian4.ZERO = Object.freeze(new $dba8420c01d8a224$var$Cartesian4(0.0, 0.0, 0.0, 0.0));\n/**\n * An immutable Cartesian4 instance initialized to (1.0, 1.0, 1.0, 1.0).\n *\n * @type {Cartesian4}\n * @constant\n */ $dba8420c01d8a224$var$Cartesian4.ONE = Object.freeze(new $dba8420c01d8a224$var$Cartesian4(1.0, 1.0, 1.0, 1.0));\n/**\n * An immutable Cartesian4 instance initialized to (1.0, 0.0, 0.0, 0.0).\n *\n * @type {Cartesian4}\n * @constant\n */ $dba8420c01d8a224$var$Cartesian4.UNIT_X = Object.freeze(new $dba8420c01d8a224$var$Cartesian4(1.0, 0.0, 0.0, 0.0));\n/**\n * An immutable Cartesian4 instance initialized to (0.0, 1.0, 0.0, 0.0).\n *\n * @type {Cartesian4}\n * @constant\n */ $dba8420c01d8a224$var$Cartesian4.UNIT_Y = Object.freeze(new $dba8420c01d8a224$var$Cartesian4(0.0, 1.0, 0.0, 0.0));\n/**\n * An immutable Cartesian4 instance initialized to (0.0, 0.0, 1.0, 0.0).\n *\n * @type {Cartesian4}\n * @constant\n */ $dba8420c01d8a224$var$Cartesian4.UNIT_Z = Object.freeze(new $dba8420c01d8a224$var$Cartesian4(0.0, 0.0, 1.0, 0.0));\n/**\n * An immutable Cartesian4 instance initialized to (0.0, 0.0, 0.0, 1.0).\n *\n * @type {Cartesian4}\n * @constant\n */ $dba8420c01d8a224$var$Cartesian4.UNIT_W = Object.freeze(new $dba8420c01d8a224$var$Cartesian4(0.0, 0.0, 0.0, 1.0));\n/**\n * Duplicates this Cartesian4 instance.\n *\n * @param {Cartesian4} [result] The object onto which to store the result.\n * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided.\n */ $dba8420c01d8a224$var$Cartesian4.prototype.clone = function(result) {\n return $dba8420c01d8a224$var$Cartesian4.clone(this, result);\n};\n/**\n * Compares this Cartesian against the provided Cartesian componentwise and returns\n * true
if they are equal, false
otherwise.\n *\n * @param {Cartesian4} [right] The right hand side Cartesian.\n * @returns {boolean} true
if they are equal, false
otherwise.\n */ $dba8420c01d8a224$var$Cartesian4.prototype.equals = function(right) {\n return $dba8420c01d8a224$var$Cartesian4.equals(this, right);\n};\n/**\n * Compares this Cartesian against the provided Cartesian componentwise and returns\n * true
if they pass an absolute or relative tolerance test,\n * false
otherwise.\n *\n * @param {Cartesian4} [right] The right hand side Cartesian.\n * @param {number} [relativeEpsilon=0] The relative epsilon tolerance to use for equality testing.\n * @param {number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing.\n * @returns {boolean} true
if they are within the provided epsilon, false
otherwise.\n */ $dba8420c01d8a224$var$Cartesian4.prototype.equalsEpsilon = function(right, relativeEpsilon, absoluteEpsilon) {\n return $dba8420c01d8a224$var$Cartesian4.equalsEpsilon(this, right, relativeEpsilon, absoluteEpsilon);\n};\n/**\n * Creates a string representing this Cartesian in the format '(x, y, z, w)'.\n *\n * @returns {string} A string representing the provided Cartesian in the format '(x, y, z, w)'.\n */ $dba8420c01d8a224$var$Cartesian4.prototype.toString = function() {\n return `(${this.x}, ${this.y}, ${this.z}, ${this.w})`;\n};\n// scratchU8Array and scratchF32Array are views into the same buffer\nconst $dba8420c01d8a224$var$scratchF32Array = new Float32Array(1);\nconst $dba8420c01d8a224$var$scratchU8Array = new Uint8Array($dba8420c01d8a224$var$scratchF32Array.buffer);\nconst $dba8420c01d8a224$var$testU32 = new Uint32Array([\n 0x11223344\n]);\nconst $dba8420c01d8a224$var$testU8 = new Uint8Array($dba8420c01d8a224$var$testU32.buffer);\nconst $dba8420c01d8a224$var$littleEndian = $dba8420c01d8a224$var$testU8[0] === 0x44;\n/**\n * Packs an arbitrary floating point value to 4 values representable using uint8.\n *\n * @param {number} value A floating point number.\n * @param {Cartesian4} [result] The Cartesian4 that will contain the packed float.\n * @returns {Cartesian4} A Cartesian4 representing the float packed to values in x, y, z, and w.\n */ $dba8420c01d8a224$var$Cartesian4.packFloat = function(value, result) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.number(\"value\", value);\n //>>includeEnd('debug');\n if (!(0, $jQJji.default)(result)) result = new $dba8420c01d8a224$var$Cartesian4();\n // scratchU8Array and scratchF32Array are views into the same buffer\n $dba8420c01d8a224$var$scratchF32Array[0] = value;\n if ($dba8420c01d8a224$var$littleEndian) {\n result.x = $dba8420c01d8a224$var$scratchU8Array[0];\n result.y = $dba8420c01d8a224$var$scratchU8Array[1];\n result.z = $dba8420c01d8a224$var$scratchU8Array[2];\n result.w = $dba8420c01d8a224$var$scratchU8Array[3];\n } else {\n // convert from big-endian to little-endian\n result.x = $dba8420c01d8a224$var$scratchU8Array[3];\n result.y = $dba8420c01d8a224$var$scratchU8Array[2];\n result.z = $dba8420c01d8a224$var$scratchU8Array[1];\n result.w = $dba8420c01d8a224$var$scratchU8Array[0];\n }\n return result;\n};\n/**\n * Unpacks a float packed using Cartesian4.packFloat.\n *\n * @param {Cartesian4} packedFloat A Cartesian4 containing a float packed to 4 values representable using uint8.\n * @returns {number} The unpacked float.\n * @private\n */ $dba8420c01d8a224$var$Cartesian4.unpackFloat = function(packedFloat) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.object(\"packedFloat\", packedFloat);\n //>>includeEnd('debug');\n // scratchU8Array and scratchF32Array are views into the same buffer\n if ($dba8420c01d8a224$var$littleEndian) {\n $dba8420c01d8a224$var$scratchU8Array[0] = packedFloat.x;\n $dba8420c01d8a224$var$scratchU8Array[1] = packedFloat.y;\n $dba8420c01d8a224$var$scratchU8Array[2] = packedFloat.z;\n $dba8420c01d8a224$var$scratchU8Array[3] = packedFloat.w;\n } else {\n // convert from little-endian to big-endian\n $dba8420c01d8a224$var$scratchU8Array[0] = packedFloat.w;\n $dba8420c01d8a224$var$scratchU8Array[1] = packedFloat.z;\n $dba8420c01d8a224$var$scratchU8Array[2] = packedFloat.y;\n $dba8420c01d8a224$var$scratchU8Array[3] = packedFloat.x;\n }\n return $dba8420c01d8a224$var$scratchF32Array[0];\n};\nvar $dba8420c01d8a224$export$2e2bcd8739ae039 = $dba8420c01d8a224$var$Cartesian4;\n\n\n\nvar $3pzcG = parcelRequire(\"3pzcG\");\n\nvar $8w8ZH = parcelRequire(\"8w8ZH\");\n\nvar $jQJji = parcelRequire(\"jQJji\");\n\nvar $1vHsR = parcelRequire(\"1vHsR\");\n\nvar $AXvpI = parcelRequire(\"AXvpI\");\n\nvar $bXwZF = parcelRequire(\"bXwZF\");\n\nvar $3pzcG = parcelRequire(\"3pzcG\");\n\nvar $8w8ZH = parcelRequire(\"8w8ZH\");\n\nvar $jQJji = parcelRequire(\"jQJji\");\n\nvar $1vHsR = parcelRequire(\"1vHsR\");\n\nvar $AXvpI = parcelRequire(\"AXvpI\");\n/**\n * A 3x3 matrix, indexable as a column-major order array.\n * Constructor parameters are in row-major order for code readability.\n * @alias Matrix3\n * @constructor\n * @implements {ArrayLike\n * Returns a diagonal matrix and unitary matrix such that:\n * matrix = unitary matrix * diagonal matrix * transpose(unitary matrix)
\n *
\n * The values along the diagonal of the diagonal matrix are the eigenvalues. The columns\n * of the unitary matrix are the corresponding eigenvectors.\n *
\n *\n * @param {Matrix3} matrix The matrix to decompose into diagonal and unitary matrix. Expected to be symmetric.\n * @param {object} [result] An object with unitary and diagonal properties which are matrices onto which to store the result.\n * @returns {object} An object with unitary and diagonal properties which are the unitary and diagonal matrices, respectively.\n *\n * @example\n * const a = //... symetric matrix\n * const result = {\n * unitary : new Cesium.Matrix3(),\n * diagonal : new Cesium.Matrix3()\n * };\n * Cesium.Matrix3.computeEigenDecomposition(a, result);\n *\n * const unitaryTranspose = Cesium.Matrix3.transpose(result.unitary, new Cesium.Matrix3());\n * const b = Cesium.Matrix3.multiply(result.unitary, result.diagonal, new Cesium.Matrix3());\n * Cesium.Matrix3.multiply(b, unitaryTranspose, b); // b is now equal to a\n *\n * const lambda = Cesium.Matrix3.getColumn(result.diagonal, 0, new Cesium.Cartesian3()).x; // first eigenvalue\n * const v = Cesium.Matrix3.getColumn(result.unitary, 0, new Cesium.Cartesian3()); // first eigenvector\n * const c = Cesium.Cartesian3.multiplyByScalar(v, lambda, new Cesium.Cartesian3()); // equal to Cesium.Matrix3.multiplyByVector(a, v)\n */ $490279d1ff27cf6c$var$Matrix3.computeEigenDecomposition = function(matrix, result) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.object(\"matrix\", matrix);\n //>>includeEnd('debug');\n // This routine was created based upon Matrix Computations, 3rd ed., by Golub and Van Loan,\n // section 8.4.3 The Classical Jacobi Algorithm\n const tolerance = (0, $AXvpI.default).EPSILON20;\n const maxSweeps = 10;\n let count = 0;\n let sweep = 0;\n if (!(0, $jQJji.default)(result)) result = {};\n const unitaryMatrix = result.unitary = $490279d1ff27cf6c$var$Matrix3.clone($490279d1ff27cf6c$var$Matrix3.IDENTITY, result.unitary);\n const diagMatrix = result.diagonal = $490279d1ff27cf6c$var$Matrix3.clone(matrix, result.diagonal);\n const epsilon = tolerance * $490279d1ff27cf6c$var$computeFrobeniusNorm(diagMatrix);\n while(sweep < maxSweeps && $490279d1ff27cf6c$var$offDiagonalFrobeniusNorm(diagMatrix) > epsilon){\n $490279d1ff27cf6c$var$shurDecomposition(diagMatrix, $490279d1ff27cf6c$var$jMatrix);\n $490279d1ff27cf6c$var$Matrix3.transpose($490279d1ff27cf6c$var$jMatrix, $490279d1ff27cf6c$var$jMatrixTranspose);\n $490279d1ff27cf6c$var$Matrix3.multiply(diagMatrix, $490279d1ff27cf6c$var$jMatrix, diagMatrix);\n $490279d1ff27cf6c$var$Matrix3.multiply($490279d1ff27cf6c$var$jMatrixTranspose, diagMatrix, diagMatrix);\n $490279d1ff27cf6c$var$Matrix3.multiply(unitaryMatrix, $490279d1ff27cf6c$var$jMatrix, unitaryMatrix);\n if (++count > 2) {\n ++sweep;\n count = 0;\n }\n }\n return result;\n};\n/**\n * Computes a matrix, which contains the absolute (unsigned) values of the provided matrix's elements.\n *\n * @param {Matrix3} matrix The matrix with signed elements.\n * @param {Matrix3} result The object onto which to store the result.\n * @returns {Matrix3} The modified result parameter.\n */ $490279d1ff27cf6c$var$Matrix3.abs = function(matrix, result) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.object(\"matrix\", matrix);\n (0, $3pzcG.default).typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n result[0] = Math.abs(matrix[0]);\n result[1] = Math.abs(matrix[1]);\n result[2] = Math.abs(matrix[2]);\n result[3] = Math.abs(matrix[3]);\n result[4] = Math.abs(matrix[4]);\n result[5] = Math.abs(matrix[5]);\n result[6] = Math.abs(matrix[6]);\n result[7] = Math.abs(matrix[7]);\n result[8] = Math.abs(matrix[8]);\n return result;\n};\n/**\n * Computes the determinant of the provided matrix.\n *\n * @param {Matrix3} matrix The matrix to use.\n * @returns {number} The value of the determinant of the matrix.\n */ $490279d1ff27cf6c$var$Matrix3.determinant = function(matrix) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.object(\"matrix\", matrix);\n //>>includeEnd('debug');\n const m11 = matrix[0];\n const m21 = matrix[3];\n const m31 = matrix[6];\n const m12 = matrix[1];\n const m22 = matrix[4];\n const m32 = matrix[7];\n const m13 = matrix[2];\n const m23 = matrix[5];\n const m33 = matrix[8];\n return m11 * (m22 * m33 - m23 * m32) + m12 * (m23 * m31 - m21 * m33) + m13 * (m21 * m32 - m22 * m31);\n};\n/**\n * Computes the inverse of the provided matrix.\n *\n * @param {Matrix3} matrix The matrix to invert.\n * @param {Matrix3} result The object onto which to store the result.\n * @returns {Matrix3} The modified result parameter.\n *\n * @exception {DeveloperError} matrix is not invertible.\n */ $490279d1ff27cf6c$var$Matrix3.inverse = function(matrix, result) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.object(\"matrix\", matrix);\n (0, $3pzcG.default).typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n const m11 = matrix[0];\n const m21 = matrix[1];\n const m31 = matrix[2];\n const m12 = matrix[3];\n const m22 = matrix[4];\n const m32 = matrix[5];\n const m13 = matrix[6];\n const m23 = matrix[7];\n const m33 = matrix[8];\n const determinant = $490279d1ff27cf6c$var$Matrix3.determinant(matrix);\n //>>includeStart('debug', pragmas.debug);\n if (Math.abs(determinant) <= (0, $AXvpI.default).EPSILON15) throw new (0, $1vHsR.default)(\"matrix is not invertible\");\n //>>includeEnd('debug');\n result[0] = m22 * m33 - m23 * m32;\n result[1] = m23 * m31 - m21 * m33;\n result[2] = m21 * m32 - m22 * m31;\n result[3] = m13 * m32 - m12 * m33;\n result[4] = m11 * m33 - m13 * m31;\n result[5] = m12 * m31 - m11 * m32;\n result[6] = m12 * m23 - m13 * m22;\n result[7] = m13 * m21 - m11 * m23;\n result[8] = m11 * m22 - m12 * m21;\n const scale = 1.0 / determinant;\n return $490279d1ff27cf6c$var$Matrix3.multiplyByScalar(result, scale, result);\n};\nconst $490279d1ff27cf6c$var$scratchTransposeMatrix = new $490279d1ff27cf6c$var$Matrix3();\n/**\n * Computes the inverse transpose of a matrix.\n *\n * @param {Matrix3} matrix The matrix to transpose and invert.\n * @param {Matrix3} result The object onto which to store the result.\n * @returns {Matrix3} The modified result parameter.\n */ $490279d1ff27cf6c$var$Matrix3.inverseTranspose = function(matrix, result) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.object(\"matrix\", matrix);\n (0, $3pzcG.default).typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n return $490279d1ff27cf6c$var$Matrix3.inverse($490279d1ff27cf6c$var$Matrix3.transpose(matrix, $490279d1ff27cf6c$var$scratchTransposeMatrix), result);\n};\n/**\n * Compares the provided matrices componentwise and returns\n *true
if they are equal, false
otherwise.\n *\n * @param {Matrix3} [left] The first matrix.\n * @param {Matrix3} [right] The second matrix.\n * @returns {boolean} true
if left and right are equal, false
otherwise.\n */ $490279d1ff27cf6c$var$Matrix3.equals = function(left, right) {\n return left === right || (0, $jQJji.default)(left) && (0, $jQJji.default)(right) && left[0] === right[0] && left[1] === right[1] && left[2] === right[2] && left[3] === right[3] && left[4] === right[4] && left[5] === right[5] && left[6] === right[6] && left[7] === right[7] && left[8] === right[8];\n};\n/**\n * Compares the provided matrices componentwise and returns\n * true
if they are within the provided epsilon,\n * false
otherwise.\n *\n * @param {Matrix3} [left] The first matrix.\n * @param {Matrix3} [right] The second matrix.\n * @param {number} [epsilon=0] The epsilon to use for equality testing.\n * @returns {boolean} true
if left and right are within the provided epsilon, false
otherwise.\n */ $490279d1ff27cf6c$var$Matrix3.equalsEpsilon = function(left, right, epsilon) {\n epsilon = (0, $8w8ZH.default)(epsilon, 0);\n return left === right || (0, $jQJji.default)(left) && (0, $jQJji.default)(right) && Math.abs(left[0] - right[0]) <= epsilon && Math.abs(left[1] - right[1]) <= epsilon && Math.abs(left[2] - right[2]) <= epsilon && Math.abs(left[3] - right[3]) <= epsilon && Math.abs(left[4] - right[4]) <= epsilon && Math.abs(left[5] - right[5]) <= epsilon && Math.abs(left[6] - right[6]) <= epsilon && Math.abs(left[7] - right[7]) <= epsilon && Math.abs(left[8] - right[8]) <= epsilon;\n};\n/**\n * An immutable Matrix3 instance initialized to the identity matrix.\n *\n * @type {Matrix3}\n * @constant\n */ $490279d1ff27cf6c$var$Matrix3.IDENTITY = Object.freeze(new $490279d1ff27cf6c$var$Matrix3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0));\n/**\n * An immutable Matrix3 instance initialized to the zero matrix.\n *\n * @type {Matrix3}\n * @constant\n */ $490279d1ff27cf6c$var$Matrix3.ZERO = Object.freeze(new $490279d1ff27cf6c$var$Matrix3(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0));\n/**\n * The index into Matrix3 for column 0, row 0.\n *\n * @type {number}\n * @constant\n */ $490279d1ff27cf6c$var$Matrix3.COLUMN0ROW0 = 0;\n/**\n * The index into Matrix3 for column 0, row 1.\n *\n * @type {number}\n * @constant\n */ $490279d1ff27cf6c$var$Matrix3.COLUMN0ROW1 = 1;\n/**\n * The index into Matrix3 for column 0, row 2.\n *\n * @type {number}\n * @constant\n */ $490279d1ff27cf6c$var$Matrix3.COLUMN0ROW2 = 2;\n/**\n * The index into Matrix3 for column 1, row 0.\n *\n * @type {number}\n * @constant\n */ $490279d1ff27cf6c$var$Matrix3.COLUMN1ROW0 = 3;\n/**\n * The index into Matrix3 for column 1, row 1.\n *\n * @type {number}\n * @constant\n */ $490279d1ff27cf6c$var$Matrix3.COLUMN1ROW1 = 4;\n/**\n * The index into Matrix3 for column 1, row 2.\n *\n * @type {number}\n * @constant\n */ $490279d1ff27cf6c$var$Matrix3.COLUMN1ROW2 = 5;\n/**\n * The index into Matrix3 for column 2, row 0.\n *\n * @type {number}\n * @constant\n */ $490279d1ff27cf6c$var$Matrix3.COLUMN2ROW0 = 6;\n/**\n * The index into Matrix3 for column 2, row 1.\n *\n * @type {number}\n * @constant\n */ $490279d1ff27cf6c$var$Matrix3.COLUMN2ROW1 = 7;\n/**\n * The index into Matrix3 for column 2, row 2.\n *\n * @type {number}\n * @constant\n */ $490279d1ff27cf6c$var$Matrix3.COLUMN2ROW2 = 8;\nObject.defineProperties($490279d1ff27cf6c$var$Matrix3.prototype, {\n /**\n * Gets the number of items in the collection.\n * @memberof Matrix3.prototype\n *\n * @type {number}\n */ length: {\n get: function() {\n return $490279d1ff27cf6c$var$Matrix3.packedLength;\n }\n }\n});\n/**\n * Duplicates the provided Matrix3 instance.\n *\n * @param {Matrix3} [result] The object onto which to store the result.\n * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if one was not provided.\n */ $490279d1ff27cf6c$var$Matrix3.prototype.clone = function(result) {\n return $490279d1ff27cf6c$var$Matrix3.clone(this, result);\n};\n/**\n * Compares this matrix to the provided matrix componentwise and returns\n * true
if they are equal, false
otherwise.\n *\n * @param {Matrix3} [right] The right hand side matrix.\n * @returns {boolean} true
if they are equal, false
otherwise.\n */ $490279d1ff27cf6c$var$Matrix3.prototype.equals = function(right) {\n return $490279d1ff27cf6c$var$Matrix3.equals(this, right);\n};\n/**\n * @private\n */ $490279d1ff27cf6c$var$Matrix3.equalsArray = function(matrix, array, offset) {\n return matrix[0] === array[offset] && matrix[1] === array[offset + 1] && matrix[2] === array[offset + 2] && matrix[3] === array[offset + 3] && matrix[4] === array[offset + 4] && matrix[5] === array[offset + 5] && matrix[6] === array[offset + 6] && matrix[7] === array[offset + 7] && matrix[8] === array[offset + 8];\n};\n/**\n * Compares this matrix to the provided matrix componentwise and returns\n * true
if they are within the provided epsilon,\n * false
otherwise.\n *\n * @param {Matrix3} [right] The right hand side matrix.\n * @param {number} [epsilon=0] The epsilon to use for equality testing.\n * @returns {boolean} true
if they are within the provided epsilon, false
otherwise.\n */ $490279d1ff27cf6c$var$Matrix3.prototype.equalsEpsilon = function(right, epsilon) {\n return $490279d1ff27cf6c$var$Matrix3.equalsEpsilon(this, right, epsilon);\n};\n/**\n * Creates a string representing this Matrix with each row being\n * on a separate line and in the format '(column0, column1, column2)'.\n *\n * @returns {string} A string representing the provided Matrix with each row being on a separate line and in the format '(column0, column1, column2)'.\n */ $490279d1ff27cf6c$var$Matrix3.prototype.toString = function() {\n return `(${this[0]}, ${this[3]}, ${this[6]})\\n` + `(${this[1]}, ${this[4]}, ${this[7]})\\n` + `(${this[2]}, ${this[5]}, ${this[8]})`;\n};\nvar $490279d1ff27cf6c$export$2e2bcd8739ae039 = $490279d1ff27cf6c$var$Matrix3;\n\n\n\nvar $jQJji = parcelRequire(\"jQJji\");\n/**\n * Constructs an exception object that is thrown due to an error that can occur at runtime, e.g.,\n * out of memory, could not compile shader, etc. If a function may throw this\n * exception, the calling code should be prepared to catch it.\n * [0.0, 0.0, 0.0, 1.0]
)\n * by a 3x3 rotation matrix. This is an optimization\n * for Matrix4.multiply(m, Matrix4.fromRotationTranslation(rotation), m);
with less allocations and arithmetic operations.\n *\n * @param {Matrix4} matrix The matrix on the left-hand side.\n * @param {Matrix3} rotation The 3x3 rotation matrix on the right-hand side.\n * @param {Matrix4} result The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter.\n *\n * @example\n * // Instead of Cesium.Matrix4.multiply(m, Cesium.Matrix4.fromRotationTranslation(rotation), m);\n * Cesium.Matrix4.multiplyByMatrix3(m, rotation, m);\n */ $7ec6ab76c28fee32$var$Matrix4.multiplyByMatrix3 = function(matrix, rotation, result) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.object(\"matrix\", matrix);\n (0, $3pzcG.default).typeOf.object(\"rotation\", rotation);\n (0, $3pzcG.default).typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n const left0 = matrix[0];\n const left1 = matrix[1];\n const left2 = matrix[2];\n const left4 = matrix[4];\n const left5 = matrix[5];\n const left6 = matrix[6];\n const left8 = matrix[8];\n const left9 = matrix[9];\n const left10 = matrix[10];\n const right0 = rotation[0];\n const right1 = rotation[1];\n const right2 = rotation[2];\n const right4 = rotation[3];\n const right5 = rotation[4];\n const right6 = rotation[5];\n const right8 = rotation[6];\n const right9 = rotation[7];\n const right10 = rotation[8];\n const column0Row0 = left0 * right0 + left4 * right1 + left8 * right2;\n const column0Row1 = left1 * right0 + left5 * right1 + left9 * right2;\n const column0Row2 = left2 * right0 + left6 * right1 + left10 * right2;\n const column1Row0 = left0 * right4 + left4 * right5 + left8 * right6;\n const column1Row1 = left1 * right4 + left5 * right5 + left9 * right6;\n const column1Row2 = left2 * right4 + left6 * right5 + left10 * right6;\n const column2Row0 = left0 * right8 + left4 * right9 + left8 * right10;\n const column2Row1 = left1 * right8 + left5 * right9 + left9 * right10;\n const column2Row2 = left2 * right8 + left6 * right9 + left10 * right10;\n result[0] = column0Row0;\n result[1] = column0Row1;\n result[2] = column0Row2;\n result[3] = 0.0;\n result[4] = column1Row0;\n result[5] = column1Row1;\n result[6] = column1Row2;\n result[7] = 0.0;\n result[8] = column2Row0;\n result[9] = column2Row1;\n result[10] = column2Row2;\n result[11] = 0.0;\n result[12] = matrix[12];\n result[13] = matrix[13];\n result[14] = matrix[14];\n result[15] = matrix[15];\n return result;\n};\n/**\n * Multiplies a transformation matrix (with a bottom row of [0.0, 0.0, 0.0, 1.0]
)\n * by an implicit translation matrix defined by a {@link Cartesian3}. This is an optimization\n * for Matrix4.multiply(m, Matrix4.fromTranslation(position), m);
with less allocations and arithmetic operations.\n *\n * @param {Matrix4} matrix The matrix on the left-hand side.\n * @param {Cartesian3} translation The translation on the right-hand side.\n * @param {Matrix4} result The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter.\n *\n * @example\n * // Instead of Cesium.Matrix4.multiply(m, Cesium.Matrix4.fromTranslation(position), m);\n * Cesium.Matrix4.multiplyByTranslation(m, position, m);\n */ $7ec6ab76c28fee32$var$Matrix4.multiplyByTranslation = function(matrix, translation, result) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.object(\"matrix\", matrix);\n (0, $3pzcG.default).typeOf.object(\"translation\", translation);\n (0, $3pzcG.default).typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n const x = translation.x;\n const y = translation.y;\n const z = translation.z;\n const tx = x * matrix[0] + y * matrix[4] + z * matrix[8] + matrix[12];\n const ty = x * matrix[1] + y * matrix[5] + z * matrix[9] + matrix[13];\n const tz = x * matrix[2] + y * matrix[6] + z * matrix[10] + matrix[14];\n result[0] = matrix[0];\n result[1] = matrix[1];\n result[2] = matrix[2];\n result[3] = matrix[3];\n result[4] = matrix[4];\n result[5] = matrix[5];\n result[6] = matrix[6];\n result[7] = matrix[7];\n result[8] = matrix[8];\n result[9] = matrix[9];\n result[10] = matrix[10];\n result[11] = matrix[11];\n result[12] = tx;\n result[13] = ty;\n result[14] = tz;\n result[15] = matrix[15];\n return result;\n};\n/**\n * Multiplies an affine transformation matrix (with a bottom row of [0.0, 0.0, 0.0, 1.0]
)\n * by an implicit non-uniform scale matrix. This is an optimization\n * for Matrix4.multiply(m, Matrix4.fromUniformScale(scale), m);
, where\n * m
must be an affine matrix.\n * This function performs fewer allocations and arithmetic operations.\n *\n * @param {Matrix4} matrix The affine matrix on the left-hand side.\n * @param {Cartesian3} scale The non-uniform scale on the right-hand side.\n * @param {Matrix4} result The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter.\n *\n *\n * @example\n * // Instead of Cesium.Matrix4.multiply(m, Cesium.Matrix4.fromScale(scale), m);\n * Cesium.Matrix4.multiplyByScale(m, scale, m);\n *\n * @see Matrix4.multiplyByUniformScale\n * @see Matrix4.fromScale\n * @see Matrix4.fromUniformScale\n * @see Matrix4.setScale\n * @see Matrix4.setUniformScale\n * @see Matrix4.getScale\n */ $7ec6ab76c28fee32$var$Matrix4.multiplyByScale = function(matrix, scale, result) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.object(\"matrix\", matrix);\n (0, $3pzcG.default).typeOf.object(\"scale\", scale);\n (0, $3pzcG.default).typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n const scaleX = scale.x;\n const scaleY = scale.y;\n const scaleZ = scale.z;\n // Faster than Cartesian3.equals\n if (scaleX === 1.0 && scaleY === 1.0 && scaleZ === 1.0) return $7ec6ab76c28fee32$var$Matrix4.clone(matrix, result);\n result[0] = scaleX * matrix[0];\n result[1] = scaleX * matrix[1];\n result[2] = scaleX * matrix[2];\n result[3] = matrix[3];\n result[4] = scaleY * matrix[4];\n result[5] = scaleY * matrix[5];\n result[6] = scaleY * matrix[6];\n result[7] = matrix[7];\n result[8] = scaleZ * matrix[8];\n result[9] = scaleZ * matrix[9];\n result[10] = scaleZ * matrix[10];\n result[11] = matrix[11];\n result[12] = matrix[12];\n result[13] = matrix[13];\n result[14] = matrix[14];\n result[15] = matrix[15];\n return result;\n};\n/**\n * Computes the product of a matrix times a uniform scale, as if the scale were a scale matrix.\n *\n * @param {Matrix4} matrix The matrix on the left-hand side.\n * @param {number} scale The uniform scale on the right-hand side.\n * @param {Matrix4} result The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter.\n *\n * @example\n * // Instead of Cesium.Matrix4.multiply(m, Cesium.Matrix4.fromUniformScale(scale), m);\n * Cesium.Matrix4.multiplyByUniformScale(m, scale, m);\n *\n * @see Matrix4.multiplyByScale\n * @see Matrix4.fromScale\n * @see Matrix4.fromUniformScale\n * @see Matrix4.setScale\n * @see Matrix4.setUniformScale\n * @see Matrix4.getScale\n */ $7ec6ab76c28fee32$var$Matrix4.multiplyByUniformScale = function(matrix, scale, result) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.object(\"matrix\", matrix);\n (0, $3pzcG.default).typeOf.number(\"scale\", scale);\n (0, $3pzcG.default).typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n result[0] = matrix[0] * scale;\n result[1] = matrix[1] * scale;\n result[2] = matrix[2] * scale;\n result[3] = matrix[3];\n result[4] = matrix[4] * scale;\n result[5] = matrix[5] * scale;\n result[6] = matrix[6] * scale;\n result[7] = matrix[7];\n result[8] = matrix[8] * scale;\n result[9] = matrix[9] * scale;\n result[10] = matrix[10] * scale;\n result[11] = matrix[11];\n result[12] = matrix[12];\n result[13] = matrix[13];\n result[14] = matrix[14];\n result[15] = matrix[15];\n return result;\n};\n/**\n * Computes the product of a matrix and a column vector.\n *\n * @param {Matrix4} matrix The matrix.\n * @param {Cartesian4} cartesian The vector.\n * @param {Cartesian4} result The object onto which to store the result.\n * @returns {Cartesian4} The modified result parameter.\n */ $7ec6ab76c28fee32$var$Matrix4.multiplyByVector = function(matrix, cartesian, result) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.object(\"matrix\", matrix);\n (0, $3pzcG.default).typeOf.object(\"cartesian\", cartesian);\n (0, $3pzcG.default).typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n const vX = cartesian.x;\n const vY = cartesian.y;\n const vZ = cartesian.z;\n const vW = cartesian.w;\n const x = matrix[0] * vX + matrix[4] * vY + matrix[8] * vZ + matrix[12] * vW;\n const y = matrix[1] * vX + matrix[5] * vY + matrix[9] * vZ + matrix[13] * vW;\n const z = matrix[2] * vX + matrix[6] * vY + matrix[10] * vZ + matrix[14] * vW;\n const w = matrix[3] * vX + matrix[7] * vY + matrix[11] * vZ + matrix[15] * vW;\n result.x = x;\n result.y = y;\n result.z = z;\n result.w = w;\n return result;\n};\n/**\n * Computes the product of a matrix and a {@link Cartesian3}. This is equivalent to calling {@link Matrix4.multiplyByVector}\n * with a {@link Cartesian4} with a w
component of zero.\n *\n * @param {Matrix4} matrix The matrix.\n * @param {Cartesian3} cartesian The point.\n * @param {Cartesian3} result The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter.\n *\n * @example\n * const p = new Cesium.Cartesian3(1.0, 2.0, 3.0);\n * const result = Cesium.Matrix4.multiplyByPointAsVector(matrix, p, new Cesium.Cartesian3());\n * // A shortcut for\n * // Cartesian3 p = ...\n * // Cesium.Matrix4.multiplyByVector(matrix, new Cesium.Cartesian4(p.x, p.y, p.z, 0.0), result);\n */ $7ec6ab76c28fee32$var$Matrix4.multiplyByPointAsVector = function(matrix, cartesian, result) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.object(\"matrix\", matrix);\n (0, $3pzcG.default).typeOf.object(\"cartesian\", cartesian);\n (0, $3pzcG.default).typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n const vX = cartesian.x;\n const vY = cartesian.y;\n const vZ = cartesian.z;\n const x = matrix[0] * vX + matrix[4] * vY + matrix[8] * vZ;\n const y = matrix[1] * vX + matrix[5] * vY + matrix[9] * vZ;\n const z = matrix[2] * vX + matrix[6] * vY + matrix[10] * vZ;\n result.x = x;\n result.y = y;\n result.z = z;\n return result;\n};\n/**\n * Computes the product of a matrix and a {@link Cartesian3}. This is equivalent to calling {@link Matrix4.multiplyByVector}\n * with a {@link Cartesian4} with a w
component of 1, but returns a {@link Cartesian3} instead of a {@link Cartesian4}.\n *\n * @param {Matrix4} matrix The matrix.\n * @param {Cartesian3} cartesian The point.\n * @param {Cartesian3} result The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter.\n *\n * @example\n * const p = new Cesium.Cartesian3(1.0, 2.0, 3.0);\n * const result = Cesium.Matrix4.multiplyByPoint(matrix, p, new Cesium.Cartesian3());\n */ $7ec6ab76c28fee32$var$Matrix4.multiplyByPoint = function(matrix, cartesian, result) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.object(\"matrix\", matrix);\n (0, $3pzcG.default).typeOf.object(\"cartesian\", cartesian);\n (0, $3pzcG.default).typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n const vX = cartesian.x;\n const vY = cartesian.y;\n const vZ = cartesian.z;\n const x = matrix[0] * vX + matrix[4] * vY + matrix[8] * vZ + matrix[12];\n const y = matrix[1] * vX + matrix[5] * vY + matrix[9] * vZ + matrix[13];\n const z = matrix[2] * vX + matrix[6] * vY + matrix[10] * vZ + matrix[14];\n result.x = x;\n result.y = y;\n result.z = z;\n return result;\n};\n/**\n * Computes the product of a matrix and a scalar.\n *\n * @param {Matrix4} matrix The matrix.\n * @param {number} scalar The number to multiply by.\n * @param {Matrix4} result The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter.\n *\n * @example\n * //create a Matrix4 instance which is a scaled version of the supplied Matrix4\n * // m = [10.0, 11.0, 12.0, 13.0]\n * // [14.0, 15.0, 16.0, 17.0]\n * // [18.0, 19.0, 20.0, 21.0]\n * // [22.0, 23.0, 24.0, 25.0]\n *\n * const a = Cesium.Matrix4.multiplyByScalar(m, -2, new Cesium.Matrix4());\n *\n * // m remains the same\n * // a = [-20.0, -22.0, -24.0, -26.0]\n * // [-28.0, -30.0, -32.0, -34.0]\n * // [-36.0, -38.0, -40.0, -42.0]\n * // [-44.0, -46.0, -48.0, -50.0]\n */ $7ec6ab76c28fee32$var$Matrix4.multiplyByScalar = function(matrix, scalar, result) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.object(\"matrix\", matrix);\n (0, $3pzcG.default).typeOf.number(\"scalar\", scalar);\n (0, $3pzcG.default).typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n result[0] = matrix[0] * scalar;\n result[1] = matrix[1] * scalar;\n result[2] = matrix[2] * scalar;\n result[3] = matrix[3] * scalar;\n result[4] = matrix[4] * scalar;\n result[5] = matrix[5] * scalar;\n result[6] = matrix[6] * scalar;\n result[7] = matrix[7] * scalar;\n result[8] = matrix[8] * scalar;\n result[9] = matrix[9] * scalar;\n result[10] = matrix[10] * scalar;\n result[11] = matrix[11] * scalar;\n result[12] = matrix[12] * scalar;\n result[13] = matrix[13] * scalar;\n result[14] = matrix[14] * scalar;\n result[15] = matrix[15] * scalar;\n return result;\n};\n/**\n * Computes a negated copy of the provided matrix.\n *\n * @param {Matrix4} matrix The matrix to negate.\n * @param {Matrix4} result The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter.\n *\n * @example\n * //create a new Matrix4 instance which is a negation of a Matrix4\n * // m = [10.0, 11.0, 12.0, 13.0]\n * // [14.0, 15.0, 16.0, 17.0]\n * // [18.0, 19.0, 20.0, 21.0]\n * // [22.0, 23.0, 24.0, 25.0]\n *\n * const a = Cesium.Matrix4.negate(m, new Cesium.Matrix4());\n *\n * // m remains the same\n * // a = [-10.0, -11.0, -12.0, -13.0]\n * // [-14.0, -15.0, -16.0, -17.0]\n * // [-18.0, -19.0, -20.0, -21.0]\n * // [-22.0, -23.0, -24.0, -25.0]\n */ $7ec6ab76c28fee32$var$Matrix4.negate = function(matrix, result) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.object(\"matrix\", matrix);\n (0, $3pzcG.default).typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n result[0] = -matrix[0];\n result[1] = -matrix[1];\n result[2] = -matrix[2];\n result[3] = -matrix[3];\n result[4] = -matrix[4];\n result[5] = -matrix[5];\n result[6] = -matrix[6];\n result[7] = -matrix[7];\n result[8] = -matrix[8];\n result[9] = -matrix[9];\n result[10] = -matrix[10];\n result[11] = -matrix[11];\n result[12] = -matrix[12];\n result[13] = -matrix[13];\n result[14] = -matrix[14];\n result[15] = -matrix[15];\n return result;\n};\n/**\n * Computes the transpose of the provided matrix.\n *\n * @param {Matrix4} matrix The matrix to transpose.\n * @param {Matrix4} result The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter.\n *\n * @example\n * //returns transpose of a Matrix4\n * // m = [10.0, 11.0, 12.0, 13.0]\n * // [14.0, 15.0, 16.0, 17.0]\n * // [18.0, 19.0, 20.0, 21.0]\n * // [22.0, 23.0, 24.0, 25.0]\n *\n * const a = Cesium.Matrix4.transpose(m, new Cesium.Matrix4());\n *\n * // m remains the same\n * // a = [10.0, 14.0, 18.0, 22.0]\n * // [11.0, 15.0, 19.0, 23.0]\n * // [12.0, 16.0, 20.0, 24.0]\n * // [13.0, 17.0, 21.0, 25.0]\n */ $7ec6ab76c28fee32$var$Matrix4.transpose = function(matrix, result) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.object(\"matrix\", matrix);\n (0, $3pzcG.default).typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n const matrix1 = matrix[1];\n const matrix2 = matrix[2];\n const matrix3 = matrix[3];\n const matrix6 = matrix[6];\n const matrix7 = matrix[7];\n const matrix11 = matrix[11];\n result[0] = matrix[0];\n result[1] = matrix[4];\n result[2] = matrix[8];\n result[3] = matrix[12];\n result[4] = matrix1;\n result[5] = matrix[5];\n result[6] = matrix[9];\n result[7] = matrix[13];\n result[8] = matrix2;\n result[9] = matrix6;\n result[10] = matrix[10];\n result[11] = matrix[14];\n result[12] = matrix3;\n result[13] = matrix7;\n result[14] = matrix11;\n result[15] = matrix[15];\n return result;\n};\n/**\n * Computes a matrix, which contains the absolute (unsigned) values of the provided matrix's elements.\n *\n * @param {Matrix4} matrix The matrix with signed elements.\n * @param {Matrix4} result The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter.\n */ $7ec6ab76c28fee32$var$Matrix4.abs = function(matrix, result) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.object(\"matrix\", matrix);\n (0, $3pzcG.default).typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n result[0] = Math.abs(matrix[0]);\n result[1] = Math.abs(matrix[1]);\n result[2] = Math.abs(matrix[2]);\n result[3] = Math.abs(matrix[3]);\n result[4] = Math.abs(matrix[4]);\n result[5] = Math.abs(matrix[5]);\n result[6] = Math.abs(matrix[6]);\n result[7] = Math.abs(matrix[7]);\n result[8] = Math.abs(matrix[8]);\n result[9] = Math.abs(matrix[9]);\n result[10] = Math.abs(matrix[10]);\n result[11] = Math.abs(matrix[11]);\n result[12] = Math.abs(matrix[12]);\n result[13] = Math.abs(matrix[13]);\n result[14] = Math.abs(matrix[14]);\n result[15] = Math.abs(matrix[15]);\n return result;\n};\n/**\n * Compares the provided matrices componentwise and returns\n * true
if they are equal, false
otherwise.\n *\n * @param {Matrix4} [left] The first matrix.\n * @param {Matrix4} [right] The second matrix.\n * @returns {boolean} true
if left and right are equal, false
otherwise.\n *\n * @example\n * //compares two Matrix4 instances\n *\n * // a = [10.0, 14.0, 18.0, 22.0]\n * // [11.0, 15.0, 19.0, 23.0]\n * // [12.0, 16.0, 20.0, 24.0]\n * // [13.0, 17.0, 21.0, 25.0]\n *\n * // b = [10.0, 14.0, 18.0, 22.0]\n * // [11.0, 15.0, 19.0, 23.0]\n * // [12.0, 16.0, 20.0, 24.0]\n * // [13.0, 17.0, 21.0, 25.0]\n *\n * if(Cesium.Matrix4.equals(a,b)) {\n * console.log(\"Both matrices are equal\");\n * } else {\n * console.log(\"They are not equal\");\n * }\n *\n * //Prints \"Both matrices are equal\" on the console\n */ $7ec6ab76c28fee32$var$Matrix4.equals = function(left, right) {\n // Given that most matrices will be transformation matrices, the elements\n // are tested in order such that the test is likely to fail as early\n // as possible. I _think_ this is just as friendly to the L1 cache\n // as testing in index order. It is certainty faster in practice.\n return left === right || (0, $jQJji.default)(left) && (0, $jQJji.default)(right) && // Translation\n left[12] === right[12] && left[13] === right[13] && left[14] === right[14] && // Rotation/scale\n left[0] === right[0] && left[1] === right[1] && left[2] === right[2] && left[4] === right[4] && left[5] === right[5] && left[6] === right[6] && left[8] === right[8] && left[9] === right[9] && left[10] === right[10] && // Bottom row\n left[3] === right[3] && left[7] === right[7] && left[11] === right[11] && left[15] === right[15];\n};\n/**\n * Compares the provided matrices componentwise and returns\n * true
if they are within the provided epsilon,\n * false
otherwise.\n *\n * @param {Matrix4} [left] The first matrix.\n * @param {Matrix4} [right] The second matrix.\n * @param {number} [epsilon=0] The epsilon to use for equality testing.\n * @returns {boolean} true
if left and right are within the provided epsilon, false
otherwise.\n *\n * @example\n * //compares two Matrix4 instances\n *\n * // a = [10.5, 14.5, 18.5, 22.5]\n * // [11.5, 15.5, 19.5, 23.5]\n * // [12.5, 16.5, 20.5, 24.5]\n * // [13.5, 17.5, 21.5, 25.5]\n *\n * // b = [10.0, 14.0, 18.0, 22.0]\n * // [11.0, 15.0, 19.0, 23.0]\n * // [12.0, 16.0, 20.0, 24.0]\n * // [13.0, 17.0, 21.0, 25.0]\n *\n * if(Cesium.Matrix4.equalsEpsilon(a,b,0.1)){\n * console.log(\"Difference between both the matrices is less than 0.1\");\n * } else {\n * console.log(\"Difference between both the matrices is not less than 0.1\");\n * }\n *\n * //Prints \"Difference between both the matrices is not less than 0.1\" on the console\n */ $7ec6ab76c28fee32$var$Matrix4.equalsEpsilon = function(left, right, epsilon) {\n epsilon = (0, $8w8ZH.default)(epsilon, 0);\n return left === right || (0, $jQJji.default)(left) && (0, $jQJji.default)(right) && Math.abs(left[0] - right[0]) <= epsilon && Math.abs(left[1] - right[1]) <= epsilon && Math.abs(left[2] - right[2]) <= epsilon && Math.abs(left[3] - right[3]) <= epsilon && Math.abs(left[4] - right[4]) <= epsilon && Math.abs(left[5] - right[5]) <= epsilon && Math.abs(left[6] - right[6]) <= epsilon && Math.abs(left[7] - right[7]) <= epsilon && Math.abs(left[8] - right[8]) <= epsilon && Math.abs(left[9] - right[9]) <= epsilon && Math.abs(left[10] - right[10]) <= epsilon && Math.abs(left[11] - right[11]) <= epsilon && Math.abs(left[12] - right[12]) <= epsilon && Math.abs(left[13] - right[13]) <= epsilon && Math.abs(left[14] - right[14]) <= epsilon && Math.abs(left[15] - right[15]) <= epsilon;\n};\n/**\n * Gets the translation portion of the provided matrix, assuming the matrix is an affine transformation matrix.\n *\n * @param {Matrix4} matrix The matrix to use.\n * @param {Cartesian3} result The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter.\n */ $7ec6ab76c28fee32$var$Matrix4.getTranslation = function(matrix, result) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.object(\"matrix\", matrix);\n (0, $3pzcG.default).typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n result.x = matrix[12];\n result.y = matrix[13];\n result.z = matrix[14];\n return result;\n};\n/**\n * Gets the upper left 3x3 matrix of the provided matrix.\n *\n * @param {Matrix4} matrix The matrix to use.\n * @param {Matrix3} result The object onto which to store the result.\n * @returns {Matrix3} The modified result parameter.\n *\n * @example\n * // returns a Matrix3 instance from a Matrix4 instance\n *\n * // m = [10.0, 14.0, 18.0, 22.0]\n * // [11.0, 15.0, 19.0, 23.0]\n * // [12.0, 16.0, 20.0, 24.0]\n * // [13.0, 17.0, 21.0, 25.0]\n *\n * const b = new Cesium.Matrix3();\n * Cesium.Matrix4.getMatrix3(m,b);\n *\n * // b = [10.0, 14.0, 18.0]\n * // [11.0, 15.0, 19.0]\n * // [12.0, 16.0, 20.0]\n */ $7ec6ab76c28fee32$var$Matrix4.getMatrix3 = function(matrix, result) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.object(\"matrix\", matrix);\n (0, $3pzcG.default).typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n result[0] = matrix[0];\n result[1] = matrix[1];\n result[2] = matrix[2];\n result[3] = matrix[4];\n result[4] = matrix[5];\n result[5] = matrix[6];\n result[6] = matrix[8];\n result[7] = matrix[9];\n result[8] = matrix[10];\n return result;\n};\nconst $7ec6ab76c28fee32$var$scratchInverseRotation = new (0, $490279d1ff27cf6c$export$2e2bcd8739ae039)();\nconst $7ec6ab76c28fee32$var$scratchMatrix3Zero = new (0, $490279d1ff27cf6c$export$2e2bcd8739ae039)();\nconst $7ec6ab76c28fee32$var$scratchBottomRow = new (0, $dba8420c01d8a224$export$2e2bcd8739ae039)();\nconst $7ec6ab76c28fee32$var$scratchExpectedBottomRow = new (0, $dba8420c01d8a224$export$2e2bcd8739ae039)(0.0, 0.0, 0.0, 1.0);\n/**\n * Computes the inverse of the provided matrix using Cramers Rule.\n * If the determinant is zero, the matrix can not be inverted, and an exception is thrown.\n * If the matrix is a proper rigid transformation, it is more efficient\n * to invert it with {@link Matrix4.inverseTransformation}.\n *\n * @param {Matrix4} matrix The matrix to invert.\n * @param {Matrix4} result The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter.\n *\n * @exception {RuntimeError} matrix is not invertible because its determinate is zero.\n */ $7ec6ab76c28fee32$var$Matrix4.inverse = function(matrix, result) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.object(\"matrix\", matrix);\n (0, $3pzcG.default).typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n //\n // Ported from:\n // ftp://download.intel.com/design/PentiumIII/sml/24504301.pdf\n //\n const src0 = matrix[0];\n const src1 = matrix[4];\n const src2 = matrix[8];\n const src3 = matrix[12];\n const src4 = matrix[1];\n const src5 = matrix[5];\n const src6 = matrix[9];\n const src7 = matrix[13];\n const src8 = matrix[2];\n const src9 = matrix[6];\n const src10 = matrix[10];\n const src11 = matrix[14];\n const src12 = matrix[3];\n const src13 = matrix[7];\n const src14 = matrix[11];\n const src15 = matrix[15];\n // calculate pairs for first 8 elements (cofactors)\n let tmp0 = src10 * src15;\n let tmp1 = src11 * src14;\n let tmp2 = src9 * src15;\n let tmp3 = src11 * src13;\n let tmp4 = src9 * src14;\n let tmp5 = src10 * src13;\n let tmp6 = src8 * src15;\n let tmp7 = src11 * src12;\n let tmp8 = src8 * src14;\n let tmp9 = src10 * src12;\n let tmp10 = src8 * src13;\n let tmp11 = src9 * src12;\n // calculate first 8 elements (cofactors)\n const dst0 = tmp0 * src5 + tmp3 * src6 + tmp4 * src7 - (tmp1 * src5 + tmp2 * src6 + tmp5 * src7);\n const dst1 = tmp1 * src4 + tmp6 * src6 + tmp9 * src7 - (tmp0 * src4 + tmp7 * src6 + tmp8 * src7);\n const dst2 = tmp2 * src4 + tmp7 * src5 + tmp10 * src7 - (tmp3 * src4 + tmp6 * src5 + tmp11 * src7);\n const dst3 = tmp5 * src4 + tmp8 * src5 + tmp11 * src6 - (tmp4 * src4 + tmp9 * src5 + tmp10 * src6);\n const dst4 = tmp1 * src1 + tmp2 * src2 + tmp5 * src3 - (tmp0 * src1 + tmp3 * src2 + tmp4 * src3);\n const dst5 = tmp0 * src0 + tmp7 * src2 + tmp8 * src3 - (tmp1 * src0 + tmp6 * src2 + tmp9 * src3);\n const dst6 = tmp3 * src0 + tmp6 * src1 + tmp11 * src3 - (tmp2 * src0 + tmp7 * src1 + tmp10 * src3);\n const dst7 = tmp4 * src0 + tmp9 * src1 + tmp10 * src2 - (tmp5 * src0 + tmp8 * src1 + tmp11 * src2);\n // calculate pairs for second 8 elements (cofactors)\n tmp0 = src2 * src7;\n tmp1 = src3 * src6;\n tmp2 = src1 * src7;\n tmp3 = src3 * src5;\n tmp4 = src1 * src6;\n tmp5 = src2 * src5;\n tmp6 = src0 * src7;\n tmp7 = src3 * src4;\n tmp8 = src0 * src6;\n tmp9 = src2 * src4;\n tmp10 = src0 * src5;\n tmp11 = src1 * src4;\n // calculate second 8 elements (cofactors)\n const dst8 = tmp0 * src13 + tmp3 * src14 + tmp4 * src15 - (tmp1 * src13 + tmp2 * src14 + tmp5 * src15);\n const dst9 = tmp1 * src12 + tmp6 * src14 + tmp9 * src15 - (tmp0 * src12 + tmp7 * src14 + tmp8 * src15);\n const dst10 = tmp2 * src12 + tmp7 * src13 + tmp10 * src15 - (tmp3 * src12 + tmp6 * src13 + tmp11 * src15);\n const dst11 = tmp5 * src12 + tmp8 * src13 + tmp11 * src14 - (tmp4 * src12 + tmp9 * src13 + tmp10 * src14);\n const dst12 = tmp2 * src10 + tmp5 * src11 + tmp1 * src9 - (tmp4 * src11 + tmp0 * src9 + tmp3 * src10);\n const dst13 = tmp8 * src11 + tmp0 * src8 + tmp7 * src10 - (tmp6 * src10 + tmp9 * src11 + tmp1 * src8);\n const dst14 = tmp6 * src9 + tmp11 * src11 + tmp3 * src8 - (tmp10 * src11 + tmp2 * src8 + tmp7 * src9);\n const dst15 = tmp10 * src10 + tmp4 * src8 + tmp9 * src9 - (tmp8 * src9 + tmp11 * src10 + tmp5 * src8);\n // calculate determinant\n let det = src0 * dst0 + src1 * dst1 + src2 * dst2 + src3 * dst3;\n if (Math.abs(det) < (0, $AXvpI.default).EPSILON21) {\n // Special case for a zero scale matrix that can occur, for example,\n // when a model's node has a [0, 0, 0] scale.\n if ((0, $490279d1ff27cf6c$export$2e2bcd8739ae039).equalsEpsilon($7ec6ab76c28fee32$var$Matrix4.getMatrix3(matrix, $7ec6ab76c28fee32$var$scratchInverseRotation), $7ec6ab76c28fee32$var$scratchMatrix3Zero, (0, $AXvpI.default).EPSILON7) && (0, $dba8420c01d8a224$export$2e2bcd8739ae039).equals($7ec6ab76c28fee32$var$Matrix4.getRow(matrix, 3, $7ec6ab76c28fee32$var$scratchBottomRow), $7ec6ab76c28fee32$var$scratchExpectedBottomRow)) {\n result[0] = 0.0;\n result[1] = 0.0;\n result[2] = 0.0;\n result[3] = 0.0;\n result[4] = 0.0;\n result[5] = 0.0;\n result[6] = 0.0;\n result[7] = 0.0;\n result[8] = 0.0;\n result[9] = 0.0;\n result[10] = 0.0;\n result[11] = 0.0;\n result[12] = -matrix[12];\n result[13] = -matrix[13];\n result[14] = -matrix[14];\n result[15] = 1.0;\n return result;\n }\n throw new (0, $60086b06bf5db23f$export$2e2bcd8739ae039)(\"matrix is not invertible because its determinate is zero.\");\n }\n // calculate matrix inverse\n det = 1.0 / det;\n result[0] = dst0 * det;\n result[1] = dst1 * det;\n result[2] = dst2 * det;\n result[3] = dst3 * det;\n result[4] = dst4 * det;\n result[5] = dst5 * det;\n result[6] = dst6 * det;\n result[7] = dst7 * det;\n result[8] = dst8 * det;\n result[9] = dst9 * det;\n result[10] = dst10 * det;\n result[11] = dst11 * det;\n result[12] = dst12 * det;\n result[13] = dst13 * det;\n result[14] = dst14 * det;\n result[15] = dst15 * det;\n return result;\n};\n/**\n * Computes the inverse of the provided matrix assuming it is a proper rigid matrix,\n * where the upper left 3x3 elements are a rotation matrix,\n * and the upper three elements in the fourth column are the translation.\n * The bottom row is assumed to be [0, 0, 0, 1].\n * The matrix is not verified to be in the proper form.\n * This method is faster than computing the inverse for a general 4x4\n * matrix using {@link Matrix4.inverse}.\n *\n * @param {Matrix4} matrix The matrix to invert.\n * @param {Matrix4} result The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter.\n */ $7ec6ab76c28fee32$var$Matrix4.inverseTransformation = function(matrix, result) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.object(\"matrix\", matrix);\n (0, $3pzcG.default).typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n //This function is an optimized version of the below 4 lines.\n //const rT = Matrix3.transpose(Matrix4.getMatrix3(matrix));\n //const rTN = Matrix3.negate(rT);\n //const rTT = Matrix3.multiplyByVector(rTN, Matrix4.getTranslation(matrix));\n //return Matrix4.fromRotationTranslation(rT, rTT, result);\n const matrix0 = matrix[0];\n const matrix1 = matrix[1];\n const matrix2 = matrix[2];\n const matrix4 = matrix[4];\n const matrix5 = matrix[5];\n const matrix6 = matrix[6];\n const matrix8 = matrix[8];\n const matrix9 = matrix[9];\n const matrix10 = matrix[10];\n const vX = matrix[12];\n const vY = matrix[13];\n const vZ = matrix[14];\n const x = -matrix0 * vX - matrix1 * vY - matrix2 * vZ;\n const y = -matrix4 * vX - matrix5 * vY - matrix6 * vZ;\n const z = -matrix8 * vX - matrix9 * vY - matrix10 * vZ;\n result[0] = matrix0;\n result[1] = matrix4;\n result[2] = matrix8;\n result[3] = 0.0;\n result[4] = matrix1;\n result[5] = matrix5;\n result[6] = matrix9;\n result[7] = 0.0;\n result[8] = matrix2;\n result[9] = matrix6;\n result[10] = matrix10;\n result[11] = 0.0;\n result[12] = x;\n result[13] = y;\n result[14] = z;\n result[15] = 1.0;\n return result;\n};\nconst $7ec6ab76c28fee32$var$scratchTransposeMatrix = new $7ec6ab76c28fee32$var$Matrix4();\n/**\n * Computes the inverse transpose of a matrix.\n *\n * @param {Matrix4} matrix The matrix to transpose and invert.\n * @param {Matrix4} result The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter.\n */ $7ec6ab76c28fee32$var$Matrix4.inverseTranspose = function(matrix, result) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.object(\"matrix\", matrix);\n (0, $3pzcG.default).typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n return $7ec6ab76c28fee32$var$Matrix4.inverse($7ec6ab76c28fee32$var$Matrix4.transpose(matrix, $7ec6ab76c28fee32$var$scratchTransposeMatrix), result);\n};\n/**\n * An immutable Matrix4 instance initialized to the identity matrix.\n *\n * @type {Matrix4}\n * @constant\n */ $7ec6ab76c28fee32$var$Matrix4.IDENTITY = Object.freeze(new $7ec6ab76c28fee32$var$Matrix4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0));\n/**\n * An immutable Matrix4 instance initialized to the zero matrix.\n *\n * @type {Matrix4}\n * @constant\n */ $7ec6ab76c28fee32$var$Matrix4.ZERO = Object.freeze(new $7ec6ab76c28fee32$var$Matrix4(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0));\n/**\n * The index into Matrix4 for column 0, row 0.\n *\n * @type {number}\n * @constant\n */ $7ec6ab76c28fee32$var$Matrix4.COLUMN0ROW0 = 0;\n/**\n * The index into Matrix4 for column 0, row 1.\n *\n * @type {number}\n * @constant\n */ $7ec6ab76c28fee32$var$Matrix4.COLUMN0ROW1 = 1;\n/**\n * The index into Matrix4 for column 0, row 2.\n *\n * @type {number}\n * @constant\n */ $7ec6ab76c28fee32$var$Matrix4.COLUMN0ROW2 = 2;\n/**\n * The index into Matrix4 for column 0, row 3.\n *\n * @type {number}\n * @constant\n */ $7ec6ab76c28fee32$var$Matrix4.COLUMN0ROW3 = 3;\n/**\n * The index into Matrix4 for column 1, row 0.\n *\n * @type {number}\n * @constant\n */ $7ec6ab76c28fee32$var$Matrix4.COLUMN1ROW0 = 4;\n/**\n * The index into Matrix4 for column 1, row 1.\n *\n * @type {number}\n * @constant\n */ $7ec6ab76c28fee32$var$Matrix4.COLUMN1ROW1 = 5;\n/**\n * The index into Matrix4 for column 1, row 2.\n *\n * @type {number}\n * @constant\n */ $7ec6ab76c28fee32$var$Matrix4.COLUMN1ROW2 = 6;\n/**\n * The index into Matrix4 for column 1, row 3.\n *\n * @type {number}\n * @constant\n */ $7ec6ab76c28fee32$var$Matrix4.COLUMN1ROW3 = 7;\n/**\n * The index into Matrix4 for column 2, row 0.\n *\n * @type {number}\n * @constant\n */ $7ec6ab76c28fee32$var$Matrix4.COLUMN2ROW0 = 8;\n/**\n * The index into Matrix4 for column 2, row 1.\n *\n * @type {number}\n * @constant\n */ $7ec6ab76c28fee32$var$Matrix4.COLUMN2ROW1 = 9;\n/**\n * The index into Matrix4 for column 2, row 2.\n *\n * @type {number}\n * @constant\n */ $7ec6ab76c28fee32$var$Matrix4.COLUMN2ROW2 = 10;\n/**\n * The index into Matrix4 for column 2, row 3.\n *\n * @type {number}\n * @constant\n */ $7ec6ab76c28fee32$var$Matrix4.COLUMN2ROW3 = 11;\n/**\n * The index into Matrix4 for column 3, row 0.\n *\n * @type {number}\n * @constant\n */ $7ec6ab76c28fee32$var$Matrix4.COLUMN3ROW0 = 12;\n/**\n * The index into Matrix4 for column 3, row 1.\n *\n * @type {number}\n * @constant\n */ $7ec6ab76c28fee32$var$Matrix4.COLUMN3ROW1 = 13;\n/**\n * The index into Matrix4 for column 3, row 2.\n *\n * @type {number}\n * @constant\n */ $7ec6ab76c28fee32$var$Matrix4.COLUMN3ROW2 = 14;\n/**\n * The index into Matrix4 for column 3, row 3.\n *\n * @type {number}\n * @constant\n */ $7ec6ab76c28fee32$var$Matrix4.COLUMN3ROW3 = 15;\nObject.defineProperties($7ec6ab76c28fee32$var$Matrix4.prototype, {\n /**\n * Gets the number of items in the collection.\n * @memberof Matrix4.prototype\n *\n * @type {number}\n */ length: {\n get: function() {\n return $7ec6ab76c28fee32$var$Matrix4.packedLength;\n }\n }\n});\n/**\n * Duplicates the provided Matrix4 instance.\n *\n * @param {Matrix4} [result] The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter or a new Matrix4 instance if one was not provided.\n */ $7ec6ab76c28fee32$var$Matrix4.prototype.clone = function(result) {\n return $7ec6ab76c28fee32$var$Matrix4.clone(this, result);\n};\n/**\n * Compares this matrix to the provided matrix componentwise and returns\n * true
if they are equal, false
otherwise.\n *\n * @param {Matrix4} [right] The right hand side matrix.\n * @returns {boolean} true
if they are equal, false
otherwise.\n */ $7ec6ab76c28fee32$var$Matrix4.prototype.equals = function(right) {\n return $7ec6ab76c28fee32$var$Matrix4.equals(this, right);\n};\n/**\n * @private\n */ $7ec6ab76c28fee32$var$Matrix4.equalsArray = function(matrix, array, offset) {\n return matrix[0] === array[offset] && matrix[1] === array[offset + 1] && matrix[2] === array[offset + 2] && matrix[3] === array[offset + 3] && matrix[4] === array[offset + 4] && matrix[5] === array[offset + 5] && matrix[6] === array[offset + 6] && matrix[7] === array[offset + 7] && matrix[8] === array[offset + 8] && matrix[9] === array[offset + 9] && matrix[10] === array[offset + 10] && matrix[11] === array[offset + 11] && matrix[12] === array[offset + 12] && matrix[13] === array[offset + 13] && matrix[14] === array[offset + 14] && matrix[15] === array[offset + 15];\n};\n/**\n * Compares this matrix to the provided matrix componentwise and returns\n * true
if they are within the provided epsilon,\n * false
otherwise.\n *\n * @param {Matrix4} [right] The right hand side matrix.\n * @param {number} [epsilon=0] The epsilon to use for equality testing.\n * @returns {boolean} true
if they are within the provided epsilon, false
otherwise.\n */ $7ec6ab76c28fee32$var$Matrix4.prototype.equalsEpsilon = function(right, epsilon) {\n return $7ec6ab76c28fee32$var$Matrix4.equalsEpsilon(this, right, epsilon);\n};\n/**\n * Computes a string representing this Matrix with each row being\n * on a separate line and in the format '(column0, column1, column2, column3)'.\n *\n * @returns {string} A string representing the provided Matrix with each row being on a separate line and in the format '(column0, column1, column2, column3)'.\n */ $7ec6ab76c28fee32$var$Matrix4.prototype.toString = function() {\n 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]})`;\n};\nvar $7ec6ab76c28fee32$export$2e2bcd8739ae039 = $7ec6ab76c28fee32$var$Matrix4;\n\n\nvar $9btZb = parcelRequire(\"9btZb\");\nvar $kWQjc = parcelRequire(\"kWQjc\");\n\nvar $bXwZF = parcelRequire(\"bXwZF\");\n\n\n\nvar $3pzcG = parcelRequire(\"3pzcG\");\n\nvar $8w8ZH = parcelRequire(\"8w8ZH\");\n\nvar $jQJji = parcelRequire(\"jQJji\");\n\nvar $1vHsR = parcelRequire(\"1vHsR\");\n\nvar $3pzcG = parcelRequire(\"3pzcG\");\n/**\n * Finds an item in a sorted array.\n *\n * @function\n * @param {Array} array The sorted array to search.\n * @param {*} itemToFind The item to find in the array.\n * @param {binarySearchComparator} comparator The function to use to compare the item to\n * elements in the array.\n * @returns {number} The index of itemToFind
in the array, if it exists. If itemToFind
\n * does not exist, the return value is a negative number which is the bitwise complement (~)\n * of the index before which the itemToFind should be inserted in order to maintain the\n * sorted order of the array.\n *\n * @example\n * // Create a comparator function to search through an array of numbers.\n * function comparator(a, b) {\n * return a - b;\n * };\n * const numbers = [0, 2, 4, 6, 8];\n * const index = Cesium.binarySearch(numbers, 6, comparator); // 3\n */ function $52c19b09ece4c63f$var$binarySearch(array, itemToFind, comparator) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).defined(\"array\", array);\n (0, $3pzcG.default).defined(\"itemToFind\", itemToFind);\n (0, $3pzcG.default).defined(\"comparator\", comparator);\n //>>includeEnd('debug');\n let low = 0;\n let high = array.length - 1;\n let i;\n let comparison;\n while(low <= high){\n i = ~~((low + high) / 2);\n comparison = comparator(array[i], itemToFind);\n if (comparison < 0) {\n low = i + 1;\n continue;\n }\n if (comparison > 0) {\n high = i - 1;\n continue;\n }\n return i;\n }\n return ~(high + 1);\n}\nvar /**\n * A function used to compare two items while performing a binary search.\n * @callback binarySearchComparator\n *\n * @param {*} a An item in the array.\n * @param {*} b The item being searched for.\n * @returns {number} Returns a negative value if a
is less than b
,\n * a positive value if a
is greater than b
, or\n * 0 if a
is equal to b
.\n *\n * @example\n * function compareNumbers(a, b) {\n * return a - b;\n * }\n */ $52c19b09ece4c63f$export$2e2bcd8739ae039 = $52c19b09ece4c63f$var$binarySearch;\n\n\n\nvar $3pzcG = parcelRequire(\"3pzcG\");\n\nvar $8w8ZH = parcelRequire(\"8w8ZH\");\n\nvar $jQJji = parcelRequire(\"jQJji\");\n/**\n * A set of Earth Orientation Parameters (EOP) sampled at a time.\n *\n * @alias EarthOrientationParametersSample\n * @constructor\n *\n * @param {number} xPoleWander The pole wander about the X axis, in radians.\n * @param {number} yPoleWander The pole wander about the Y axis, in radians.\n * @param {number} xPoleOffset The offset to the Celestial Intermediate Pole (CIP) about the X axis, in radians.\n * @param {number} yPoleOffset The offset to the Celestial Intermediate Pole (CIP) about the Y axis, in radians.\n * @param {number} ut1MinusUtc The difference in time standards, UT1 - UTC, in seconds.\n *\n * @private\n */ function $733293b70aae4cad$var$EarthOrientationParametersSample(xPoleWander, yPoleWander, xPoleOffset, yPoleOffset, ut1MinusUtc) {\n /**\n * The pole wander about the X axis, in radians.\n * @type {number}\n */ this.xPoleWander = xPoleWander;\n /**\n * The pole wander about the Y axis, in radians.\n * @type {number}\n */ this.yPoleWander = yPoleWander;\n /**\n * The offset to the Celestial Intermediate Pole (CIP) about the X axis, in radians.\n * @type {number}\n */ this.xPoleOffset = xPoleOffset;\n /**\n * The offset to the Celestial Intermediate Pole (CIP) about the Y axis, in radians.\n * @type {number}\n */ this.yPoleOffset = yPoleOffset;\n /**\n * The difference in time standards, UT1 - UTC, in seconds.\n * @type {number}\n */ this.ut1MinusUtc = ut1MinusUtc;\n}\nvar $733293b70aae4cad$export$2e2bcd8739ae039 = $733293b70aae4cad$var$EarthOrientationParametersSample;\n\n\n\n\nvar $8w8ZH = parcelRequire(\"8w8ZH\");\n\nvar $jQJji = parcelRequire(\"jQJji\");\n\nvar $1vHsR = parcelRequire(\"1vHsR\");\n\nvar $3pzcG = parcelRequire(\"3pzcG\");\n\nvar $8w8ZH = parcelRequire(\"8w8ZH\");\n\nvar $1vHsR = parcelRequire(\"1vHsR\");\n\nvar $1vHsR = parcelRequire(\"1vHsR\");\n/**\n * Determines if a given date is a leap year.\n *\n * @function isLeapYear\n *\n * @param {number} year The year to be tested.\n * @returns {boolean} True if year
is a leap year.\n *\n * @example\n * const leapYear = Cesium.isLeapYear(2000); // true\n */ function $86dc94fb6bcfc713$var$isLeapYear(year) {\n //>>includeStart('debug', pragmas.debug);\n if (year === null || isNaN(year)) throw new (0, $1vHsR.default)(\"year is required and must be a number.\");\n //>>includeEnd('debug');\n return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;\n}\nvar $86dc94fb6bcfc713$export$2e2bcd8739ae039 = $86dc94fb6bcfc713$var$isLeapYear;\n\n\nconst $33ab1ce7e2935ae4$var$daysInYear = [\n 31,\n 28,\n 31,\n 30,\n 31,\n 30,\n 31,\n 31,\n 30,\n 31,\n 30,\n 31\n];\n/**\n * Represents a Gregorian date in a more precise format than the JavaScript Date object.\n * In addition to submillisecond precision, this object can also represent leap seconds.\n * @alias GregorianDate\n * @constructor\n *\n * @param {number} [year] The year as a whole number.\n * @param {number} [month] The month as a whole number with range [1, 12].\n * @param {number} [day] The day of the month as a whole number starting at 1.\n * @param {number} [hour] The hour as a whole number with range [0, 23].\n * @param {number} [minute] The minute of the hour as a whole number with range [0, 59].\n * @param {number} [second] The second of the minute as a whole number with range [0, 60], with 60 representing a leap second.\n * @param {number} [millisecond] The millisecond of the second as a floating point number with range [0.0, 1000.0).\n * @param {boolean} [isLeapSecond] Whether this time is during a leap second.\n *\n * @see JulianDate#toGregorianDate\n */ function $33ab1ce7e2935ae4$var$GregorianDate(year, month, day, hour, minute, second, millisecond, isLeapSecond) {\n const minimumYear = 1;\n const minimumMonth = 1;\n const minimumDay = 1;\n const minimumHour = 0;\n const minimumMinute = 0;\n const minimumSecond = 0;\n const minimumMillisecond = 0;\n year = (0, $8w8ZH.default)(year, minimumYear);\n month = (0, $8w8ZH.default)(month, minimumMonth);\n day = (0, $8w8ZH.default)(day, minimumDay);\n hour = (0, $8w8ZH.default)(hour, minimumHour);\n minute = (0, $8w8ZH.default)(minute, minimumMinute);\n second = (0, $8w8ZH.default)(second, minimumSecond);\n millisecond = (0, $8w8ZH.default)(millisecond, minimumMillisecond);\n isLeapSecond = (0, $8w8ZH.default)(isLeapSecond, false);\n //>>includeStart('debug', pragmas.debug);\n validateRange();\n validateDate();\n //>>includeEnd('debug');\n /**\n * Gets or sets the year as a whole number.\n * @type {number}\n */ this.year = year;\n /**\n * Gets or sets the month as a whole number with range [1, 12].\n * @type {number}\n */ this.month = month;\n /**\n * Gets or sets the day of the month as a whole number starting at 1.\n * @type {number}\n */ this.day = day;\n /**\n * Gets or sets the hour as a whole number with range [0, 23].\n * @type {number}\n */ this.hour = hour;\n /**\n * Gets or sets the minute of the hour as a whole number with range [0, 59].\n * @type {number}\n */ this.minute = minute;\n /**\n * Gets or sets the second of the minute as a whole number with range [0, 60], with 60 representing a leap second.\n * @type {number}\n */ this.second = second;\n /**\n * Gets or sets the millisecond of the second as a floating point number with range [0.0, 1000.0).\n * @type {number}\n */ this.millisecond = millisecond;\n /**\n * Gets or sets whether this time is during a leap second.\n * @type {boolean}\n */ this.isLeapSecond = isLeapSecond;\n function validateRange() {\n const maximumYear = 9999;\n const maximumMonth = 12;\n const maximumDay = 31;\n const maximumHour = 23;\n const maximumMinute = 59;\n const maximumSecond = 59;\n const excludedMaximumMilisecond = 1000;\n (0, $3pzcG.default).typeOf.number.greaterThanOrEquals(\"Year\", year, minimumYear);\n (0, $3pzcG.default).typeOf.number.lessThanOrEquals(\"Year\", year, maximumYear);\n (0, $3pzcG.default).typeOf.number.greaterThanOrEquals(\"Month\", month, minimumMonth);\n (0, $3pzcG.default).typeOf.number.lessThanOrEquals(\"Month\", month, maximumMonth);\n (0, $3pzcG.default).typeOf.number.greaterThanOrEquals(\"Day\", day, minimumDay);\n (0, $3pzcG.default).typeOf.number.lessThanOrEquals(\"Day\", day, maximumDay);\n (0, $3pzcG.default).typeOf.number.greaterThanOrEquals(\"Hour\", hour, minimumHour);\n (0, $3pzcG.default).typeOf.number.lessThanOrEquals(\"Hour\", hour, maximumHour);\n (0, $3pzcG.default).typeOf.number.greaterThanOrEquals(\"Minute\", minute, minimumMinute);\n (0, $3pzcG.default).typeOf.number.lessThanOrEquals(\"Minute\", minute, maximumMinute);\n (0, $3pzcG.default).typeOf.bool(\"IsLeapSecond\", isLeapSecond);\n (0, $3pzcG.default).typeOf.number.greaterThanOrEquals(\"Second\", second, minimumSecond);\n (0, $3pzcG.default).typeOf.number.lessThanOrEquals(\"Second\", second, isLeapSecond ? maximumSecond + 1 : maximumSecond);\n (0, $3pzcG.default).typeOf.number.greaterThanOrEquals(\"Millisecond\", millisecond, minimumMillisecond);\n (0, $3pzcG.default).typeOf.number.lessThan(\"Millisecond\", millisecond, excludedMaximumMilisecond);\n }\n // Javascript date object supports only dates greater than 1901. Thus validating with custom logic\n function validateDate() {\n const daysInMonth = month === 2 && (0, $86dc94fb6bcfc713$export$2e2bcd8739ae039)(year) ? $33ab1ce7e2935ae4$var$daysInYear[month - 1] + 1 : $33ab1ce7e2935ae4$var$daysInYear[month - 1];\n if (day > daysInMonth) throw new (0, $1vHsR.default)(\"Month and Day represents invalid date\");\n }\n}\nvar $33ab1ce7e2935ae4$export$2e2bcd8739ae039 = $33ab1ce7e2935ae4$var$GregorianDate;\n\n\n\n/**\n * Describes a single leap second, which is constructed from a {@link JulianDate} and a\n * numerical offset representing the number of seconds TAI is ahead of the UTC time standard.\n * @alias LeapSecond\n * @constructor\n *\n * @param {JulianDate} [date] A Julian date representing the time of the leap second.\n * @param {number} [offset] The cumulative number of seconds that TAI is ahead of UTC at the provided date.\n */ function $97869fccaa735547$var$LeapSecond(date, offset) {\n /**\n * Gets or sets the date at which this leap second occurs.\n * @type {JulianDate}\n */ this.julianDate = date;\n /**\n * Gets or sets the cumulative number of seconds between the UTC and TAI time standards at the time\n * of this leap second.\n * @type {number}\n */ this.offset = offset;\n}\nvar $97869fccaa735547$export$2e2bcd8739ae039 = $97869fccaa735547$var$LeapSecond;\n\n\n/**\n * Constants for time conversions like those done by {@link JulianDate}.\n *\n * @namespace TimeConstants\n *\n * @see JulianDate\n *\n * @private\n */ const $e3d50c782acbaff1$var$TimeConstants = {\n /**\n * The number of seconds in one millisecond: 0.001
\n * @type {number}\n * @constant\n */ SECONDS_PER_MILLISECOND: 0.001,\n /**\n * The number of seconds in one minute: 60
.\n * @type {number}\n * @constant\n */ SECONDS_PER_MINUTE: 60.0,\n /**\n * The number of minutes in one hour: 60
.\n * @type {number}\n * @constant\n */ MINUTES_PER_HOUR: 60.0,\n /**\n * The number of hours in one day: 24
.\n * @type {number}\n * @constant\n */ HOURS_PER_DAY: 24.0,\n /**\n * The number of seconds in one hour: 3600
.\n * @type {number}\n * @constant\n */ SECONDS_PER_HOUR: 3600.0,\n /**\n * The number of minutes in one day: 1440
.\n * @type {number}\n * @constant\n */ MINUTES_PER_DAY: 1440.0,\n /**\n * The number of seconds in one day, ignoring leap seconds: 86400
.\n * @type {number}\n * @constant\n */ SECONDS_PER_DAY: 86400.0,\n /**\n * The number of days in one Julian century: 36525
.\n * @type {number}\n * @constant\n */ DAYS_PER_JULIAN_CENTURY: 36525.0,\n /**\n * One trillionth of a second.\n * @type {number}\n * @constant\n */ PICOSECOND: 0.000000001,\n /**\n * The number of days to subtract from a Julian date to determine the\n * modified Julian date, which gives the number of days since midnight\n * on November 17, 1858.\n * @type {number}\n * @constant\n */ MODIFIED_JULIAN_DATE_DIFFERENCE: 2400000.5\n};\nvar $e3d50c782acbaff1$export$2e2bcd8739ae039 = Object.freeze($e3d50c782acbaff1$var$TimeConstants);\n\n\n/**\n * Provides the type of time standards which JulianDate can take as input.\n *\n * @enum {number}\n *\n * @see JulianDate\n */ const $134462e760c5c083$var$TimeStandard = {\n /**\n * Represents the coordinated Universal Time (UTC) time standard.\n *\n * UTC is related to TAI according to the relationship\n * UTC = TAI - deltaT
where deltaT
is the number of leap\n * seconds which have been introduced as of the time in TAI.\n *\n * @type {number}\n * @constant\n */ UTC: 0,\n /**\n * Represents the International Atomic Time (TAI) time standard.\n * TAI is the principal time standard to which the other time standards are related.\n *\n * @type {number}\n * @constant\n */ TAI: 1\n};\nvar $134462e760c5c083$export$2e2bcd8739ae039 = Object.freeze($134462e760c5c083$var$TimeStandard);\n\n\nconst $73b9691e04761700$var$gregorianDateScratch = new (0, $33ab1ce7e2935ae4$export$2e2bcd8739ae039)();\nconst $73b9691e04761700$var$daysInMonth = [\n 31,\n 28,\n 31,\n 30,\n 31,\n 30,\n 31,\n 31,\n 30,\n 31,\n 30,\n 31\n];\nconst $73b9691e04761700$var$daysInLeapFeburary = 29;\nfunction $73b9691e04761700$var$compareLeapSecondDates(leapSecond, dateToFind) {\n return $73b9691e04761700$var$JulianDate.compare(leapSecond.julianDate, dateToFind.julianDate);\n}\n// we don't really need a leap second instance, anything with a julianDate property will do\nconst $73b9691e04761700$var$binarySearchScratchLeapSecond = new (0, $97869fccaa735547$export$2e2bcd8739ae039)();\nfunction $73b9691e04761700$var$convertUtcToTai(julianDate) {\n //Even though julianDate is in UTC, we'll treat it as TAI and\n //search the leap second table for it.\n $73b9691e04761700$var$binarySearchScratchLeapSecond.julianDate = julianDate;\n const leapSeconds = $73b9691e04761700$var$JulianDate.leapSeconds;\n let index = (0, $52c19b09ece4c63f$export$2e2bcd8739ae039)(leapSeconds, $73b9691e04761700$var$binarySearchScratchLeapSecond, $73b9691e04761700$var$compareLeapSecondDates);\n if (index < 0) index = ~index;\n if (index >= leapSeconds.length) index = leapSeconds.length - 1;\n let offset = leapSeconds[index].offset;\n if (index > 0) {\n //Now we have the index of the closest leap second that comes on or after our UTC time.\n //However, if the difference between the UTC date being converted and the TAI\n //defined leap second is greater than the offset, we are off by one and need to use\n //the previous leap second.\n const difference = $73b9691e04761700$var$JulianDate.secondsDifference(leapSeconds[index].julianDate, julianDate);\n if (difference > offset) {\n index--;\n offset = leapSeconds[index].offset;\n }\n }\n $73b9691e04761700$var$JulianDate.addSeconds(julianDate, offset, julianDate);\n}\nfunction $73b9691e04761700$var$convertTaiToUtc(julianDate, result) {\n $73b9691e04761700$var$binarySearchScratchLeapSecond.julianDate = julianDate;\n const leapSeconds = $73b9691e04761700$var$JulianDate.leapSeconds;\n let index = (0, $52c19b09ece4c63f$export$2e2bcd8739ae039)(leapSeconds, $73b9691e04761700$var$binarySearchScratchLeapSecond, $73b9691e04761700$var$compareLeapSecondDates);\n if (index < 0) index = ~index;\n //All times before our first leap second get the first offset.\n if (index === 0) return $73b9691e04761700$var$JulianDate.addSeconds(julianDate, -leapSeconds[0].offset, result);\n //All times after our leap second get the last offset.\n if (index >= leapSeconds.length) return $73b9691e04761700$var$JulianDate.addSeconds(julianDate, -leapSeconds[index - 1].offset, result);\n //Compute the difference between the found leap second and the time we are converting.\n const difference = $73b9691e04761700$var$JulianDate.secondsDifference(leapSeconds[index].julianDate, julianDate);\n if (difference === 0) //The date is in our leap second table.\n return $73b9691e04761700$var$JulianDate.addSeconds(julianDate, -leapSeconds[index].offset, result);\n if (difference <= 1.0) //The requested date is during the moment of a leap second, then we cannot convert to UTC\n return undefined;\n //The time is in between two leap seconds, index is the leap second after the date\n //we're converting, so we subtract one to get the correct LeapSecond instance.\n return $73b9691e04761700$var$JulianDate.addSeconds(julianDate, -leapSeconds[--index].offset, result);\n}\nfunction $73b9691e04761700$var$setComponents(wholeDays, secondsOfDay, julianDate) {\n const extraDays = secondsOfDay / (0, $e3d50c782acbaff1$export$2e2bcd8739ae039).SECONDS_PER_DAY | 0;\n wholeDays += extraDays;\n secondsOfDay -= (0, $e3d50c782acbaff1$export$2e2bcd8739ae039).SECONDS_PER_DAY * extraDays;\n if (secondsOfDay < 0) {\n wholeDays--;\n secondsOfDay += (0, $e3d50c782acbaff1$export$2e2bcd8739ae039).SECONDS_PER_DAY;\n }\n julianDate.dayNumber = wholeDays;\n julianDate.secondsOfDay = secondsOfDay;\n return julianDate;\n}\nfunction $73b9691e04761700$var$computeJulianDateComponents(year, month, day, hour, minute, second, millisecond) {\n // Algorithm from page 604 of the Explanatory Supplement to the\n // Astronomical Almanac (Seidelmann 1992).\n const a = (month - 14) / 12 | 0;\n const b = year + 4800 + a;\n let dayNumber = (1461 * b / 4 | 0) + (367 * (month - 2 - 12 * a) / 12 | 0) - (3 * ((b + 100) / 100 | 0) / 4 | 0) + day - 32075;\n // JulianDates are noon-based\n hour = hour - 12;\n if (hour < 0) hour += 24;\n const secondsOfDay = second + (hour * (0, $e3d50c782acbaff1$export$2e2bcd8739ae039).SECONDS_PER_HOUR + minute * (0, $e3d50c782acbaff1$export$2e2bcd8739ae039).SECONDS_PER_MINUTE + millisecond * (0, $e3d50c782acbaff1$export$2e2bcd8739ae039).SECONDS_PER_MILLISECOND);\n if (secondsOfDay >= 43200.0) dayNumber -= 1;\n return [\n dayNumber,\n secondsOfDay\n ];\n}\n//Regular expressions used for ISO8601 date parsing.\n//YYYY\nconst $73b9691e04761700$var$matchCalendarYear = /^(\\d{4})$/;\n//YYYY-MM (YYYYMM is invalid)\nconst $73b9691e04761700$var$matchCalendarMonth = /^(\\d{4})-(\\d{2})$/;\n//YYYY-DDD or YYYYDDD\nconst $73b9691e04761700$var$matchOrdinalDate = /^(\\d{4})-?(\\d{3})$/;\n//YYYY-Www or YYYYWww or YYYY-Www-D or YYYYWwwD\nconst $73b9691e04761700$var$matchWeekDate = /^(\\d{4})-?W(\\d{2})-?(\\d{1})?$/;\n//YYYY-MM-DD or YYYYMMDD\nconst $73b9691e04761700$var$matchCalendarDate = /^(\\d{4})-?(\\d{2})-?(\\d{2})$/;\n// Match utc offset\nconst $73b9691e04761700$var$utcOffset = /([Z+\\-])?(\\d{2})?:?(\\d{2})?$/;\n// Match hours HH or HH.xxxxx\nconst $73b9691e04761700$var$matchHours = /^(\\d{2})(\\.\\d+)?/.source + $73b9691e04761700$var$utcOffset.source;\n// Match hours/minutes HH:MM HHMM.xxxxx\nconst $73b9691e04761700$var$matchHoursMinutes = /^(\\d{2}):?(\\d{2})(\\.\\d+)?/.source + $73b9691e04761700$var$utcOffset.source;\n// Match hours/minutes HH:MM:SS HHMMSS.xxxxx\nconst $73b9691e04761700$var$matchHoursMinutesSeconds = /^(\\d{2}):?(\\d{2}):?(\\d{2})(\\.\\d+)?/.source + $73b9691e04761700$var$utcOffset.source;\nconst $73b9691e04761700$var$iso8601ErrorMessage = \"Invalid ISO 8601 date.\";\n/**\n * Represents an astronomical Julian date, which is the number of days since noon on January 1, -4712 (4713 BC).\n * For increased precision, this class stores the whole number part of the date and the seconds\n * part of the date in separate components. In order to be safe for arithmetic and represent\n * leap seconds, the date is always stored in the International Atomic Time standard\n * {@link TimeStandard.TAI}.\n * @alias JulianDate\n * @constructor\n *\n * @param {number} [julianDayNumber=0.0] The Julian Day Number representing the number of whole days. Fractional days will also be handled correctly.\n * @param {number} [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.\n * @param {TimeStandard} [timeStandard=TimeStandard.UTC] The time standard in which the first two parameters are defined.\n */ function $73b9691e04761700$var$JulianDate(julianDayNumber, secondsOfDay, timeStandard) {\n /**\n * Gets or sets the number of whole days.\n * @type {number}\n */ this.dayNumber = undefined;\n /**\n * Gets or sets the number of seconds into the current day.\n * @type {number}\n */ this.secondsOfDay = undefined;\n julianDayNumber = (0, $8w8ZH.default)(julianDayNumber, 0.0);\n secondsOfDay = (0, $8w8ZH.default)(secondsOfDay, 0.0);\n timeStandard = (0, $8w8ZH.default)(timeStandard, (0, $134462e760c5c083$export$2e2bcd8739ae039).UTC);\n //If julianDayNumber is fractional, make it an integer and add the number of seconds the fraction represented.\n const wholeDays = julianDayNumber | 0;\n secondsOfDay = secondsOfDay + (julianDayNumber - wholeDays) * (0, $e3d50c782acbaff1$export$2e2bcd8739ae039).SECONDS_PER_DAY;\n $73b9691e04761700$var$setComponents(wholeDays, secondsOfDay, this);\n if (timeStandard === (0, $134462e760c5c083$export$2e2bcd8739ae039).UTC) $73b9691e04761700$var$convertUtcToTai(this);\n}\n/**\n * Creates a new instance from a GregorianDate.\n *\n * @param {GregorianDate} date A GregorianDate.\n * @param {JulianDate} [result] An existing instance to use for the result.\n * @returns {JulianDate} The modified result parameter or a new instance if none was provided.\n *\n * @exception {DeveloperError} date must be a valid GregorianDate.\n */ $73b9691e04761700$var$JulianDate.fromGregorianDate = function(date, result) {\n //>>includeStart('debug', pragmas.debug);\n if (!(date instanceof (0, $33ab1ce7e2935ae4$export$2e2bcd8739ae039))) throw new (0, $1vHsR.default)(\"date must be a valid GregorianDate.\");\n //>>includeEnd('debug');\n const components = $73b9691e04761700$var$computeJulianDateComponents(date.year, date.month, date.day, date.hour, date.minute, date.second, date.millisecond);\n if (!(0, $jQJji.default)(result)) return new $73b9691e04761700$var$JulianDate(components[0], components[1], (0, $134462e760c5c083$export$2e2bcd8739ae039).UTC);\n $73b9691e04761700$var$setComponents(components[0], components[1], result);\n $73b9691e04761700$var$convertUtcToTai(result);\n return result;\n};\n/**\n * Creates a new instance from a JavaScript Date.\n *\n * @param {Date} date A JavaScript Date.\n * @param {JulianDate} [result] An existing instance to use for the result.\n * @returns {JulianDate} The modified result parameter or a new instance if none was provided.\n *\n * @exception {DeveloperError} date must be a valid JavaScript Date.\n */ $73b9691e04761700$var$JulianDate.fromDate = function(date, result) {\n //>>includeStart('debug', pragmas.debug);\n if (!(date instanceof Date) || isNaN(date.getTime())) throw new (0, $1vHsR.default)(\"date must be a valid JavaScript Date.\");\n //>>includeEnd('debug');\n const components = $73b9691e04761700$var$computeJulianDateComponents(date.getUTCFullYear(), date.getUTCMonth() + 1, date.getUTCDate(), date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds(), date.getUTCMilliseconds());\n if (!(0, $jQJji.default)(result)) return new $73b9691e04761700$var$JulianDate(components[0], components[1], (0, $134462e760c5c083$export$2e2bcd8739ae039).UTC);\n $73b9691e04761700$var$setComponents(components[0], components[1], result);\n $73b9691e04761700$var$convertUtcToTai(result);\n return result;\n};\n/**\n * Creates a new instance from a from an {@link http://en.wikipedia.org/wiki/ISO_8601|ISO 8601} date.\n * This method is superior to Date.parse
because it will handle all valid formats defined by the ISO 8601\n * specification, including leap seconds and sub-millisecond times, which discarded by most JavaScript implementations.\n *\n * @param {string} iso8601String An ISO 8601 date.\n * @param {JulianDate} [result] An existing instance to use for the result.\n * @returns {JulianDate} The modified result parameter or a new instance if none was provided.\n *\n * @exception {DeveloperError} Invalid ISO 8601 date.\n */ $73b9691e04761700$var$JulianDate.fromIso8601 = function(iso8601String, result) {\n //>>includeStart('debug', pragmas.debug);\n if (typeof iso8601String !== \"string\") throw new (0, $1vHsR.default)($73b9691e04761700$var$iso8601ErrorMessage);\n //>>includeEnd('debug');\n //Comma and decimal point both indicate a fractional number according to ISO 8601,\n //start out by blanket replacing , with . which is the only valid such symbol in JS.\n iso8601String = iso8601String.replace(\",\", \".\");\n //Split the string into its date and time components, denoted by a mandatory T\n let tokens = iso8601String.split(\"T\");\n let year;\n let month = 1;\n let day = 1;\n let hour = 0;\n let minute = 0;\n let second = 0;\n let millisecond = 0;\n //Lacking a time is okay, but a missing date is illegal.\n const date = tokens[0];\n const time = tokens[1];\n let tmp;\n let inLeapYear;\n //>>includeStart('debug', pragmas.debug);\n if (!(0, $jQJji.default)(date)) throw new (0, $1vHsR.default)($73b9691e04761700$var$iso8601ErrorMessage);\n let dashCount;\n //>>includeEnd('debug');\n //First match the date against possible regular expressions.\n tokens = date.match($73b9691e04761700$var$matchCalendarDate);\n if (tokens !== null) {\n //>>includeStart('debug', pragmas.debug);\n dashCount = date.split(\"-\").length - 1;\n if (dashCount > 0 && dashCount !== 2) throw new (0, $1vHsR.default)($73b9691e04761700$var$iso8601ErrorMessage);\n //>>includeEnd('debug');\n year = +tokens[1];\n month = +tokens[2];\n day = +tokens[3];\n } else {\n tokens = date.match($73b9691e04761700$var$matchCalendarMonth);\n if (tokens !== null) {\n year = +tokens[1];\n month = +tokens[2];\n } else {\n tokens = date.match($73b9691e04761700$var$matchCalendarYear);\n if (tokens !== null) year = +tokens[1];\n else {\n //Not a year/month/day so it must be an ordinal date.\n let dayOfYear;\n tokens = date.match($73b9691e04761700$var$matchOrdinalDate);\n if (tokens !== null) {\n year = +tokens[1];\n dayOfYear = +tokens[2];\n inLeapYear = (0, $86dc94fb6bcfc713$export$2e2bcd8739ae039)(year);\n //This validation is only applicable for this format.\n //>>includeStart('debug', pragmas.debug);\n if (dayOfYear < 1 || inLeapYear && dayOfYear > 366 || !inLeapYear && dayOfYear > 365) throw new (0, $1vHsR.default)($73b9691e04761700$var$iso8601ErrorMessage);\n //>>includeEnd('debug')\n } else {\n tokens = date.match($73b9691e04761700$var$matchWeekDate);\n if (tokens !== null) {\n //ISO week date to ordinal date from\n //http://en.wikipedia.org/w/index.php?title=ISO_week_date&oldid=474176775\n year = +tokens[1];\n const weekNumber = +tokens[2];\n const dayOfWeek = +tokens[3] || 0;\n //>>includeStart('debug', pragmas.debug);\n dashCount = date.split(\"-\").length - 1;\n if (dashCount > 0 && (!(0, $jQJji.default)(tokens[3]) && dashCount !== 1 || (0, $jQJji.default)(tokens[3]) && dashCount !== 2)) throw new (0, $1vHsR.default)($73b9691e04761700$var$iso8601ErrorMessage);\n //>>includeEnd('debug')\n const january4 = new Date(Date.UTC(year, 0, 4));\n dayOfYear = weekNumber * 7 + dayOfWeek - january4.getUTCDay() - 3;\n } else //None of our regular expressions succeeded in parsing the date properly.\n //>>includeStart('debug', pragmas.debug);\n throw new (0, $1vHsR.default)($73b9691e04761700$var$iso8601ErrorMessage);\n }\n //Split an ordinal date into month/day.\n tmp = new Date(Date.UTC(year, 0, 1));\n tmp.setUTCDate(dayOfYear);\n month = tmp.getUTCMonth() + 1;\n day = tmp.getUTCDate();\n }\n }\n }\n //Now that we have all of the date components, validate them to make sure nothing is out of range.\n inLeapYear = (0, $86dc94fb6bcfc713$export$2e2bcd8739ae039)(year);\n //>>includeStart('debug', pragmas.debug);\n if (month < 1 || month > 12 || day < 1 || (month !== 2 || !inLeapYear) && day > $73b9691e04761700$var$daysInMonth[month - 1] || inLeapYear && month === 2 && day > $73b9691e04761700$var$daysInLeapFeburary) throw new (0, $1vHsR.default)($73b9691e04761700$var$iso8601ErrorMessage);\n //>>includeEnd('debug')\n //Now move onto the time string, which is much simpler.\n //If no time is specified, it is considered the beginning of the day, UTC to match Javascript's implementation.\n let offsetIndex;\n if ((0, $jQJji.default)(time)) {\n tokens = time.match($73b9691e04761700$var$matchHoursMinutesSeconds);\n if (tokens !== null) {\n //>>includeStart('debug', pragmas.debug);\n dashCount = time.split(\":\").length - 1;\n if (dashCount > 0 && dashCount !== 2 && dashCount !== 3) throw new (0, $1vHsR.default)($73b9691e04761700$var$iso8601ErrorMessage);\n //>>includeEnd('debug')\n hour = +tokens[1];\n minute = +tokens[2];\n second = +tokens[3];\n millisecond = +(tokens[4] || 0) * 1000.0;\n offsetIndex = 5;\n } else {\n tokens = time.match($73b9691e04761700$var$matchHoursMinutes);\n if (tokens !== null) {\n //>>includeStart('debug', pragmas.debug);\n dashCount = time.split(\":\").length - 1;\n if (dashCount > 2) throw new (0, $1vHsR.default)($73b9691e04761700$var$iso8601ErrorMessage);\n //>>includeEnd('debug')\n hour = +tokens[1];\n minute = +tokens[2];\n second = +(tokens[3] || 0) * 60.0;\n offsetIndex = 4;\n } else {\n tokens = time.match($73b9691e04761700$var$matchHours);\n if (tokens !== null) {\n hour = +tokens[1];\n minute = +(tokens[2] || 0) * 60.0;\n offsetIndex = 3;\n } else //>>includeStart('debug', pragmas.debug);\n throw new (0, $1vHsR.default)($73b9691e04761700$var$iso8601ErrorMessage);\n }\n }\n //Validate that all values are in proper range. Minutes and hours have special cases at 60 and 24.\n //>>includeStart('debug', pragmas.debug);\n if (minute >= 60 || second >= 61 || hour > 24 || hour === 24 && (minute > 0 || second > 0 || millisecond > 0)) throw new (0, $1vHsR.default)($73b9691e04761700$var$iso8601ErrorMessage);\n //>>includeEnd('debug');\n //Check the UTC offset value, if no value exists, use local time\n //a Z indicates UTC, + or - are offsets.\n const offset = tokens[offsetIndex];\n const offsetHours = +tokens[offsetIndex + 1];\n const offsetMinutes = +(tokens[offsetIndex + 2] || 0);\n switch(offset){\n case \"+\":\n hour = hour - offsetHours;\n minute = minute - offsetMinutes;\n break;\n case \"-\":\n hour = hour + offsetHours;\n minute = minute + offsetMinutes;\n break;\n case \"Z\":\n break;\n default:\n minute = minute + new Date(Date.UTC(year, month - 1, day, hour, minute)).getTimezoneOffset();\n break;\n }\n }\n //ISO8601 denotes a leap second by any time having a seconds component of 60 seconds.\n //If that's the case, we need to temporarily subtract a second in order to build a UTC date.\n //Then we add it back in after converting to TAI.\n const isLeapSecond = second === 60;\n if (isLeapSecond) second--;\n //Even if we successfully parsed the string into its components, after applying UTC offset or\n //special cases like 24:00:00 denoting midnight, we need to normalize the data appropriately.\n //milliseconds can never be greater than 1000, and seconds can't be above 60, so we start with minutes\n while(minute >= 60){\n minute -= 60;\n hour++;\n }\n while(hour >= 24){\n hour -= 24;\n day++;\n }\n tmp = inLeapYear && month === 2 ? $73b9691e04761700$var$daysInLeapFeburary : $73b9691e04761700$var$daysInMonth[month - 1];\n while(day > tmp){\n day -= tmp;\n month++;\n if (month > 12) {\n month -= 12;\n year++;\n }\n tmp = inLeapYear && month === 2 ? $73b9691e04761700$var$daysInLeapFeburary : $73b9691e04761700$var$daysInMonth[month - 1];\n }\n //If UTC offset is at the beginning/end of the day, minutes can be negative.\n while(minute < 0){\n minute += 60;\n hour--;\n }\n while(hour < 0){\n hour += 24;\n day--;\n }\n while(day < 1){\n month--;\n if (month < 1) {\n month += 12;\n year--;\n }\n tmp = inLeapYear && month === 2 ? $73b9691e04761700$var$daysInLeapFeburary : $73b9691e04761700$var$daysInMonth[month - 1];\n day += tmp;\n }\n //Now create the JulianDate components from the Gregorian date and actually create our instance.\n const components = $73b9691e04761700$var$computeJulianDateComponents(year, month, day, hour, minute, second, millisecond);\n if (!(0, $jQJji.default)(result)) result = new $73b9691e04761700$var$JulianDate(components[0], components[1], (0, $134462e760c5c083$export$2e2bcd8739ae039).UTC);\n else {\n $73b9691e04761700$var$setComponents(components[0], components[1], result);\n $73b9691e04761700$var$convertUtcToTai(result);\n }\n //If we were on a leap second, add it back.\n if (isLeapSecond) $73b9691e04761700$var$JulianDate.addSeconds(result, 1, result);\n return result;\n};\n/**\n * Creates a new instance that represents the current system time.\n * This is equivalent to calling JulianDate.fromDate(new Date());
.\n *\n * @param {JulianDate} [result] An existing instance to use for the result.\n * @returns {JulianDate} The modified result parameter or a new instance if none was provided.\n */ $73b9691e04761700$var$JulianDate.now = function(result) {\n return $73b9691e04761700$var$JulianDate.fromDate(new Date(), result);\n};\nconst $73b9691e04761700$var$toGregorianDateScratch = new $73b9691e04761700$var$JulianDate(0, 0, (0, $134462e760c5c083$export$2e2bcd8739ae039).TAI);\n/**\n * Creates a {@link GregorianDate} from the provided instance.\n *\n * @param {JulianDate} julianDate The date to be converted.\n * @param {GregorianDate} [result] An existing instance to use for the result.\n * @returns {GregorianDate} The modified result parameter or a new instance if none was provided.\n */ $73b9691e04761700$var$JulianDate.toGregorianDate = function(julianDate, result) {\n //>>includeStart('debug', pragmas.debug);\n if (!(0, $jQJji.default)(julianDate)) throw new (0, $1vHsR.default)(\"julianDate is required.\");\n //>>includeEnd('debug');\n let isLeapSecond = false;\n let thisUtc = $73b9691e04761700$var$convertTaiToUtc(julianDate, $73b9691e04761700$var$toGregorianDateScratch);\n if (!(0, $jQJji.default)(thisUtc)) {\n //Conversion to UTC will fail if we are during a leap second.\n //If that's the case, subtract a second and convert again.\n //JavaScript doesn't support leap seconds, so this results in second 59 being repeated twice.\n $73b9691e04761700$var$JulianDate.addSeconds(julianDate, -1, $73b9691e04761700$var$toGregorianDateScratch);\n thisUtc = $73b9691e04761700$var$convertTaiToUtc($73b9691e04761700$var$toGregorianDateScratch, $73b9691e04761700$var$toGregorianDateScratch);\n isLeapSecond = true;\n }\n let julianDayNumber = thisUtc.dayNumber;\n const secondsOfDay = thisUtc.secondsOfDay;\n if (secondsOfDay >= 43200.0) julianDayNumber += 1;\n // Algorithm from page 604 of the Explanatory Supplement to the\n // Astronomical Almanac (Seidelmann 1992).\n let L = julianDayNumber + 68569 | 0;\n const N = 4 * L / 146097 | 0;\n L = L - ((146097 * N + 3) / 4 | 0) | 0;\n const I = 4000 * (L + 1) / 1461001 | 0;\n L = L - (1461 * I / 4 | 0) + 31 | 0;\n const J = 80 * L / 2447 | 0;\n const day = L - (2447 * J / 80 | 0) | 0;\n L = J / 11 | 0;\n const month = J + 2 - 12 * L | 0;\n const year = 100 * (N - 49) + I + L | 0;\n let hour = secondsOfDay / (0, $e3d50c782acbaff1$export$2e2bcd8739ae039).SECONDS_PER_HOUR | 0;\n let remainingSeconds = secondsOfDay - hour * (0, $e3d50c782acbaff1$export$2e2bcd8739ae039).SECONDS_PER_HOUR;\n const minute = remainingSeconds / (0, $e3d50c782acbaff1$export$2e2bcd8739ae039).SECONDS_PER_MINUTE | 0;\n remainingSeconds = remainingSeconds - minute * (0, $e3d50c782acbaff1$export$2e2bcd8739ae039).SECONDS_PER_MINUTE;\n let second = remainingSeconds | 0;\n const millisecond = (remainingSeconds - second) / (0, $e3d50c782acbaff1$export$2e2bcd8739ae039).SECONDS_PER_MILLISECOND;\n // JulianDates are noon-based\n hour += 12;\n if (hour > 23) hour -= 24;\n //If we were on a leap second, add it back.\n if (isLeapSecond) second += 1;\n if (!(0, $jQJji.default)(result)) return new (0, $33ab1ce7e2935ae4$export$2e2bcd8739ae039)(year, month, day, hour, minute, second, millisecond, isLeapSecond);\n result.year = year;\n result.month = month;\n result.day = day;\n result.hour = hour;\n result.minute = minute;\n result.second = second;\n result.millisecond = millisecond;\n result.isLeapSecond = isLeapSecond;\n return result;\n};\n/**\n * Creates a JavaScript Date from the provided instance.\n * Since JavaScript dates are only accurate to the nearest millisecond and\n * cannot represent a leap second, consider using {@link JulianDate.toGregorianDate} instead.\n * If the provided JulianDate is during a leap second, the previous second is used.\n *\n * @param {JulianDate} julianDate The date to be converted.\n * @returns {Date} A new instance representing the provided date.\n */ $73b9691e04761700$var$JulianDate.toDate = function(julianDate) {\n //>>includeStart('debug', pragmas.debug);\n if (!(0, $jQJji.default)(julianDate)) throw new (0, $1vHsR.default)(\"julianDate is required.\");\n //>>includeEnd('debug');\n const gDate = $73b9691e04761700$var$JulianDate.toGregorianDate(julianDate, $73b9691e04761700$var$gregorianDateScratch);\n let second = gDate.second;\n if (gDate.isLeapSecond) second -= 1;\n return new Date(Date.UTC(gDate.year, gDate.month - 1, gDate.day, gDate.hour, gDate.minute, second, gDate.millisecond));\n};\n/**\n * Creates an ISO8601 representation of the provided date.\n *\n * @param {JulianDate} julianDate The date to be converted.\n * @param {number} [precision] The number of fractional digits used to represent the seconds component. By default, the most precise representation is used.\n * @returns {string} The ISO8601 representation of the provided date.\n */ $73b9691e04761700$var$JulianDate.toIso8601 = function(julianDate, precision) {\n //>>includeStart('debug', pragmas.debug);\n if (!(0, $jQJji.default)(julianDate)) throw new (0, $1vHsR.default)(\"julianDate is required.\");\n //>>includeEnd('debug');\n const gDate = $73b9691e04761700$var$JulianDate.toGregorianDate(julianDate, $73b9691e04761700$var$gregorianDateScratch);\n let year = gDate.year;\n let month = gDate.month;\n let day = gDate.day;\n let hour = gDate.hour;\n const minute = gDate.minute;\n const second = gDate.second;\n const millisecond = gDate.millisecond;\n // special case - Iso8601.MAXIMUM_VALUE produces a string which we can't parse unless we adjust.\n // 10000-01-01T00:00:00 is the same instant as 9999-12-31T24:00:00\n if (year === 10000 && month === 1 && day === 1 && hour === 0 && minute === 0 && second === 0 && millisecond === 0) {\n year = 9999;\n month = 12;\n day = 31;\n hour = 24;\n }\n let millisecondStr;\n if (!(0, $jQJji.default)(precision) && millisecond !== 0) {\n //Forces milliseconds into a number with at least 3 digits to whatever the default toString() precision is.\n millisecondStr = (millisecond * 0.01).toString().replace(\".\", \"\");\n return `${year.toString().padStart(4, \"0\")}-${month.toString().padStart(2, \"0\")}-${day.toString().padStart(2, \"0\")}T${hour.toString().padStart(2, \"0\")}:${minute.toString().padStart(2, \"0\")}:${second.toString().padStart(2, \"0\")}.${millisecondStr}Z`;\n }\n //Precision is either 0 or milliseconds is 0 with undefined precision, in either case, leave off milliseconds entirely\n if (!(0, $jQJji.default)(precision) || precision === 0) return `${year.toString().padStart(4, \"0\")}-${month.toString().padStart(2, \"0\")}-${day.toString().padStart(2, \"0\")}T${hour.toString().padStart(2, \"0\")}:${minute.toString().padStart(2, \"0\")}:${second.toString().padStart(2, \"0\")}Z`;\n //Forces milliseconds into a number with at least 3 digits to whatever the specified precision is.\n millisecondStr = (millisecond * 0.01).toFixed(precision).replace(\".\", \"\").slice(0, precision);\n return `${year.toString().padStart(4, \"0\")}-${month.toString().padStart(2, \"0\")}-${day.toString().padStart(2, \"0\")}T${hour.toString().padStart(2, \"0\")}:${minute.toString().padStart(2, \"0\")}:${second.toString().padStart(2, \"0\")}.${millisecondStr}Z`;\n};\n/**\n * Duplicates a JulianDate instance.\n *\n * @param {JulianDate} julianDate The date to duplicate.\n * @param {JulianDate} [result] An existing instance to use for the result.\n * @returns {JulianDate} The modified result parameter or a new instance if none was provided. Returns undefined if julianDate is undefined.\n */ $73b9691e04761700$var$JulianDate.clone = function(julianDate, result) {\n if (!(0, $jQJji.default)(julianDate)) return undefined;\n if (!(0, $jQJji.default)(result)) return new $73b9691e04761700$var$JulianDate(julianDate.dayNumber, julianDate.secondsOfDay, (0, $134462e760c5c083$export$2e2bcd8739ae039).TAI);\n result.dayNumber = julianDate.dayNumber;\n result.secondsOfDay = julianDate.secondsOfDay;\n return result;\n};\n/**\n * Compares two instances.\n *\n * @param {JulianDate} left The first instance.\n * @param {JulianDate} right The second instance.\n * @returns {number} 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.\n */ $73b9691e04761700$var$JulianDate.compare = function(left, right) {\n //>>includeStart('debug', pragmas.debug);\n if (!(0, $jQJji.default)(left)) throw new (0, $1vHsR.default)(\"left is required.\");\n if (!(0, $jQJji.default)(right)) throw new (0, $1vHsR.default)(\"right is required.\");\n //>>includeEnd('debug');\n const julianDayNumberDifference = left.dayNumber - right.dayNumber;\n if (julianDayNumberDifference !== 0) return julianDayNumberDifference;\n return left.secondsOfDay - right.secondsOfDay;\n};\n/**\n * Compares two instances and returns true
if they are equal, false
otherwise.\n *\n * @param {JulianDate} [left] The first instance.\n * @param {JulianDate} [right] The second instance.\n * @returns {boolean} true
if the dates are equal; otherwise, false
.\n */ $73b9691e04761700$var$JulianDate.equals = function(left, right) {\n return left === right || (0, $jQJji.default)(left) && (0, $jQJji.default)(right) && left.dayNumber === right.dayNumber && left.secondsOfDay === right.secondsOfDay;\n};\n/**\n * Compares two instances and returns true
if they are within epsilon
seconds of\n * each other. That is, in order for the dates to be considered equal (and for\n * this function to return true
), the absolute value of the difference between them, in\n * seconds, must be less than epsilon
.\n *\n * @param {JulianDate} [left] The first instance.\n * @param {JulianDate} [right] The second instance.\n * @param {number} [epsilon=0] The maximum number of seconds that should separate the two instances.\n * @returns {boolean} true
if the two dates are within epsilon
seconds of each other; otherwise false
.\n */ $73b9691e04761700$var$JulianDate.equalsEpsilon = function(left, right, epsilon) {\n epsilon = (0, $8w8ZH.default)(epsilon, 0);\n return left === right || (0, $jQJji.default)(left) && (0, $jQJji.default)(right) && Math.abs($73b9691e04761700$var$JulianDate.secondsDifference(left, right)) <= epsilon;\n};\n/**\n * Computes the total number of whole and fractional days represented by the provided instance.\n *\n * @param {JulianDate} julianDate The date.\n * @returns {number} The Julian date as single floating point number.\n */ $73b9691e04761700$var$JulianDate.totalDays = function(julianDate) {\n //>>includeStart('debug', pragmas.debug);\n if (!(0, $jQJji.default)(julianDate)) throw new (0, $1vHsR.default)(\"julianDate is required.\");\n //>>includeEnd('debug');\n return julianDate.dayNumber + julianDate.secondsOfDay / (0, $e3d50c782acbaff1$export$2e2bcd8739ae039).SECONDS_PER_DAY;\n};\n/**\n * Computes the difference in seconds between the provided instance.\n *\n * @param {JulianDate} left The first instance.\n * @param {JulianDate} right The second instance.\n * @returns {number} The difference, in seconds, when subtracting right
from left
.\n */ $73b9691e04761700$var$JulianDate.secondsDifference = function(left, right) {\n //>>includeStart('debug', pragmas.debug);\n if (!(0, $jQJji.default)(left)) throw new (0, $1vHsR.default)(\"left is required.\");\n if (!(0, $jQJji.default)(right)) throw new (0, $1vHsR.default)(\"right is required.\");\n //>>includeEnd('debug');\n const dayDifference = (left.dayNumber - right.dayNumber) * (0, $e3d50c782acbaff1$export$2e2bcd8739ae039).SECONDS_PER_DAY;\n return dayDifference + (left.secondsOfDay - right.secondsOfDay);\n};\n/**\n * Computes the difference in days between the provided instance.\n *\n * @param {JulianDate} left The first instance.\n * @param {JulianDate} right The second instance.\n * @returns {number} The difference, in days, when subtracting right
from left
.\n */ $73b9691e04761700$var$JulianDate.daysDifference = function(left, right) {\n //>>includeStart('debug', pragmas.debug);\n if (!(0, $jQJji.default)(left)) throw new (0, $1vHsR.default)(\"left is required.\");\n if (!(0, $jQJji.default)(right)) throw new (0, $1vHsR.default)(\"right is required.\");\n //>>includeEnd('debug');\n const dayDifference = left.dayNumber - right.dayNumber;\n const secondDifference = (left.secondsOfDay - right.secondsOfDay) / (0, $e3d50c782acbaff1$export$2e2bcd8739ae039).SECONDS_PER_DAY;\n return dayDifference + secondDifference;\n};\n/**\n * Computes the number of seconds the provided instance is ahead of UTC.\n *\n * @param {JulianDate} julianDate The date.\n * @returns {number} The number of seconds the provided instance is ahead of UTC\n */ $73b9691e04761700$var$JulianDate.computeTaiMinusUtc = function(julianDate) {\n $73b9691e04761700$var$binarySearchScratchLeapSecond.julianDate = julianDate;\n const leapSeconds = $73b9691e04761700$var$JulianDate.leapSeconds;\n let index = (0, $52c19b09ece4c63f$export$2e2bcd8739ae039)(leapSeconds, $73b9691e04761700$var$binarySearchScratchLeapSecond, $73b9691e04761700$var$compareLeapSecondDates);\n if (index < 0) {\n index = ~index;\n --index;\n if (index < 0) index = 0;\n }\n return leapSeconds[index].offset;\n};\n/**\n * Adds the provided number of seconds to the provided date instance.\n *\n * @param {JulianDate} julianDate The date.\n * @param {number} seconds The number of seconds to add or subtract.\n * @param {JulianDate} result An existing instance to use for the result.\n * @returns {JulianDate} The modified result parameter.\n */ $73b9691e04761700$var$JulianDate.addSeconds = function(julianDate, seconds, result) {\n //>>includeStart('debug', pragmas.debug);\n if (!(0, $jQJji.default)(julianDate)) throw new (0, $1vHsR.default)(\"julianDate is required.\");\n if (!(0, $jQJji.default)(seconds)) throw new (0, $1vHsR.default)(\"seconds is required.\");\n if (!(0, $jQJji.default)(result)) throw new (0, $1vHsR.default)(\"result is required.\");\n //>>includeEnd('debug');\n return $73b9691e04761700$var$setComponents(julianDate.dayNumber, julianDate.secondsOfDay + seconds, result);\n};\n/**\n * Adds the provided number of minutes to the provided date instance.\n *\n * @param {JulianDate} julianDate The date.\n * @param {number} minutes The number of minutes to add or subtract.\n * @param {JulianDate} result An existing instance to use for the result.\n * @returns {JulianDate} The modified result parameter.\n */ $73b9691e04761700$var$JulianDate.addMinutes = function(julianDate, minutes, result) {\n //>>includeStart('debug', pragmas.debug);\n if (!(0, $jQJji.default)(julianDate)) throw new (0, $1vHsR.default)(\"julianDate is required.\");\n if (!(0, $jQJji.default)(minutes)) throw new (0, $1vHsR.default)(\"minutes is required.\");\n if (!(0, $jQJji.default)(result)) throw new (0, $1vHsR.default)(\"result is required.\");\n //>>includeEnd('debug');\n const newSecondsOfDay = julianDate.secondsOfDay + minutes * (0, $e3d50c782acbaff1$export$2e2bcd8739ae039).SECONDS_PER_MINUTE;\n return $73b9691e04761700$var$setComponents(julianDate.dayNumber, newSecondsOfDay, result);\n};\n/**\n * Adds the provided number of hours to the provided date instance.\n *\n * @param {JulianDate} julianDate The date.\n * @param {number} hours The number of hours to add or subtract.\n * @param {JulianDate} result An existing instance to use for the result.\n * @returns {JulianDate} The modified result parameter.\n */ $73b9691e04761700$var$JulianDate.addHours = function(julianDate, hours, result) {\n //>>includeStart('debug', pragmas.debug);\n if (!(0, $jQJji.default)(julianDate)) throw new (0, $1vHsR.default)(\"julianDate is required.\");\n if (!(0, $jQJji.default)(hours)) throw new (0, $1vHsR.default)(\"hours is required.\");\n if (!(0, $jQJji.default)(result)) throw new (0, $1vHsR.default)(\"result is required.\");\n //>>includeEnd('debug');\n const newSecondsOfDay = julianDate.secondsOfDay + hours * (0, $e3d50c782acbaff1$export$2e2bcd8739ae039).SECONDS_PER_HOUR;\n return $73b9691e04761700$var$setComponents(julianDate.dayNumber, newSecondsOfDay, result);\n};\n/**\n * Adds the provided number of days to the provided date instance.\n *\n * @param {JulianDate} julianDate The date.\n * @param {number} days The number of days to add or subtract.\n * @param {JulianDate} result An existing instance to use for the result.\n * @returns {JulianDate} The modified result parameter.\n */ $73b9691e04761700$var$JulianDate.addDays = function(julianDate, days, result) {\n //>>includeStart('debug', pragmas.debug);\n if (!(0, $jQJji.default)(julianDate)) throw new (0, $1vHsR.default)(\"julianDate is required.\");\n if (!(0, $jQJji.default)(days)) throw new (0, $1vHsR.default)(\"days is required.\");\n if (!(0, $jQJji.default)(result)) throw new (0, $1vHsR.default)(\"result is required.\");\n //>>includeEnd('debug');\n const newJulianDayNumber = julianDate.dayNumber + days;\n return $73b9691e04761700$var$setComponents(newJulianDayNumber, julianDate.secondsOfDay, result);\n};\n/**\n * Compares the provided instances and returns true
if left
is earlier than right
, false
otherwise.\n *\n * @param {JulianDate} left The first instance.\n * @param {JulianDate} right The second instance.\n * @returns {boolean} true
if left
is earlier than right
, false
otherwise.\n */ $73b9691e04761700$var$JulianDate.lessThan = function(left, right) {\n return $73b9691e04761700$var$JulianDate.compare(left, right) < 0;\n};\n/**\n * Compares the provided instances and returns true
if left
is earlier than or equal to right
, false
otherwise.\n *\n * @param {JulianDate} left The first instance.\n * @param {JulianDate} right The second instance.\n * @returns {boolean} true
if left
is earlier than or equal to right
, false
otherwise.\n */ $73b9691e04761700$var$JulianDate.lessThanOrEquals = function(left, right) {\n return $73b9691e04761700$var$JulianDate.compare(left, right) <= 0;\n};\n/**\n * Compares the provided instances and returns true
if left
is later than right
, false
otherwise.\n *\n * @param {JulianDate} left The first instance.\n * @param {JulianDate} right The second instance.\n * @returns {boolean} true
if left
is later than right
, false
otherwise.\n */ $73b9691e04761700$var$JulianDate.greaterThan = function(left, right) {\n return $73b9691e04761700$var$JulianDate.compare(left, right) > 0;\n};\n/**\n * Compares the provided instances and returns true
if left
is later than or equal to right
, false
otherwise.\n *\n * @param {JulianDate} left The first instance.\n * @param {JulianDate} right The second instance.\n * @returns {boolean} true
if left
is later than or equal to right
, false
otherwise.\n */ $73b9691e04761700$var$JulianDate.greaterThanOrEquals = function(left, right) {\n return $73b9691e04761700$var$JulianDate.compare(left, right) >= 0;\n};\n/**\n * Duplicates this instance.\n *\n * @param {JulianDate} [result] An existing instance to use for the result.\n * @returns {JulianDate} The modified result parameter or a new instance if none was provided.\n */ $73b9691e04761700$var$JulianDate.prototype.clone = function(result) {\n return $73b9691e04761700$var$JulianDate.clone(this, result);\n};\n/**\n * Compares this and the provided instance and returns true
if they are equal, false
otherwise.\n *\n * @param {JulianDate} [right] The second instance.\n * @returns {boolean} true
if the dates are equal; otherwise, false
.\n */ $73b9691e04761700$var$JulianDate.prototype.equals = function(right) {\n return $73b9691e04761700$var$JulianDate.equals(this, right);\n};\n/**\n * Compares this and the provided instance and returns true
if they are within epsilon
seconds of\n * each other. That is, in order for the dates to be considered equal (and for\n * this function to return true
), the absolute value of the difference between them, in\n * seconds, must be less than epsilon
.\n *\n * @param {JulianDate} [right] The second instance.\n * @param {number} [epsilon=0] The maximum number of seconds that should separate the two instances.\n * @returns {boolean} true
if the two dates are within epsilon
seconds of each other; otherwise false
.\n */ $73b9691e04761700$var$JulianDate.prototype.equalsEpsilon = function(right, epsilon) {\n return $73b9691e04761700$var$JulianDate.equalsEpsilon(this, right, epsilon);\n};\n/**\n * Creates a string representing this date in ISO8601 format.\n *\n * @returns {string} A string representing this date in ISO8601 format.\n */ $73b9691e04761700$var$JulianDate.prototype.toString = function() {\n return $73b9691e04761700$var$JulianDate.toIso8601(this);\n};\n/**\n * Gets or sets the list of leap seconds used throughout Cesium.\n * @memberof JulianDate\n * @type {LeapSecond[]}\n */ $73b9691e04761700$var$JulianDate.leapSeconds = [\n new (0, $97869fccaa735547$export$2e2bcd8739ae039)(new $73b9691e04761700$var$JulianDate(2441317, 43210.0, (0, $134462e760c5c083$export$2e2bcd8739ae039).TAI), 10),\n new (0, $97869fccaa735547$export$2e2bcd8739ae039)(new $73b9691e04761700$var$JulianDate(2441499, 43211.0, (0, $134462e760c5c083$export$2e2bcd8739ae039).TAI), 11),\n new (0, $97869fccaa735547$export$2e2bcd8739ae039)(new $73b9691e04761700$var$JulianDate(2441683, 43212.0, (0, $134462e760c5c083$export$2e2bcd8739ae039).TAI), 12),\n new (0, $97869fccaa735547$export$2e2bcd8739ae039)(new $73b9691e04761700$var$JulianDate(2442048, 43213.0, (0, $134462e760c5c083$export$2e2bcd8739ae039).TAI), 13),\n new (0, $97869fccaa735547$export$2e2bcd8739ae039)(new $73b9691e04761700$var$JulianDate(2442413, 43214.0, (0, $134462e760c5c083$export$2e2bcd8739ae039).TAI), 14),\n new (0, $97869fccaa735547$export$2e2bcd8739ae039)(new $73b9691e04761700$var$JulianDate(2442778, 43215.0, (0, $134462e760c5c083$export$2e2bcd8739ae039).TAI), 15),\n new (0, $97869fccaa735547$export$2e2bcd8739ae039)(new $73b9691e04761700$var$JulianDate(2443144, 43216.0, (0, $134462e760c5c083$export$2e2bcd8739ae039).TAI), 16),\n new (0, $97869fccaa735547$export$2e2bcd8739ae039)(new $73b9691e04761700$var$JulianDate(2443509, 43217.0, (0, $134462e760c5c083$export$2e2bcd8739ae039).TAI), 17),\n new (0, $97869fccaa735547$export$2e2bcd8739ae039)(new $73b9691e04761700$var$JulianDate(2443874, 43218.0, (0, $134462e760c5c083$export$2e2bcd8739ae039).TAI), 18),\n new (0, $97869fccaa735547$export$2e2bcd8739ae039)(new $73b9691e04761700$var$JulianDate(2444239, 43219.0, (0, $134462e760c5c083$export$2e2bcd8739ae039).TAI), 19),\n new (0, $97869fccaa735547$export$2e2bcd8739ae039)(new $73b9691e04761700$var$JulianDate(2444786, 43220.0, (0, $134462e760c5c083$export$2e2bcd8739ae039).TAI), 20),\n new (0, $97869fccaa735547$export$2e2bcd8739ae039)(new $73b9691e04761700$var$JulianDate(2445151, 43221.0, (0, $134462e760c5c083$export$2e2bcd8739ae039).TAI), 21),\n new (0, $97869fccaa735547$export$2e2bcd8739ae039)(new $73b9691e04761700$var$JulianDate(2445516, 43222.0, (0, $134462e760c5c083$export$2e2bcd8739ae039).TAI), 22),\n new (0, $97869fccaa735547$export$2e2bcd8739ae039)(new $73b9691e04761700$var$JulianDate(2446247, 43223.0, (0, $134462e760c5c083$export$2e2bcd8739ae039).TAI), 23),\n new (0, $97869fccaa735547$export$2e2bcd8739ae039)(new $73b9691e04761700$var$JulianDate(2447161, 43224.0, (0, $134462e760c5c083$export$2e2bcd8739ae039).TAI), 24),\n new (0, $97869fccaa735547$export$2e2bcd8739ae039)(new $73b9691e04761700$var$JulianDate(2447892, 43225.0, (0, $134462e760c5c083$export$2e2bcd8739ae039).TAI), 25),\n new (0, $97869fccaa735547$export$2e2bcd8739ae039)(new $73b9691e04761700$var$JulianDate(2448257, 43226.0, (0, $134462e760c5c083$export$2e2bcd8739ae039).TAI), 26),\n new (0, $97869fccaa735547$export$2e2bcd8739ae039)(new $73b9691e04761700$var$JulianDate(2448804, 43227.0, (0, $134462e760c5c083$export$2e2bcd8739ae039).TAI), 27),\n new (0, $97869fccaa735547$export$2e2bcd8739ae039)(new $73b9691e04761700$var$JulianDate(2449169, 43228.0, (0, $134462e760c5c083$export$2e2bcd8739ae039).TAI), 28),\n new (0, $97869fccaa735547$export$2e2bcd8739ae039)(new $73b9691e04761700$var$JulianDate(2449534, 43229.0, (0, $134462e760c5c083$export$2e2bcd8739ae039).TAI), 29),\n new (0, $97869fccaa735547$export$2e2bcd8739ae039)(new $73b9691e04761700$var$JulianDate(2450083, 43230.0, (0, $134462e760c5c083$export$2e2bcd8739ae039).TAI), 30),\n new (0, $97869fccaa735547$export$2e2bcd8739ae039)(new $73b9691e04761700$var$JulianDate(2450630, 43231.0, (0, $134462e760c5c083$export$2e2bcd8739ae039).TAI), 31),\n new (0, $97869fccaa735547$export$2e2bcd8739ae039)(new $73b9691e04761700$var$JulianDate(2451179, 43232.0, (0, $134462e760c5c083$export$2e2bcd8739ae039).TAI), 32),\n new (0, $97869fccaa735547$export$2e2bcd8739ae039)(new $73b9691e04761700$var$JulianDate(2453736, 43233.0, (0, $134462e760c5c083$export$2e2bcd8739ae039).TAI), 33),\n new (0, $97869fccaa735547$export$2e2bcd8739ae039)(new $73b9691e04761700$var$JulianDate(2454832, 43234.0, (0, $134462e760c5c083$export$2e2bcd8739ae039).TAI), 34),\n new (0, $97869fccaa735547$export$2e2bcd8739ae039)(new $73b9691e04761700$var$JulianDate(2456109, 43235.0, (0, $134462e760c5c083$export$2e2bcd8739ae039).TAI), 35),\n new (0, $97869fccaa735547$export$2e2bcd8739ae039)(new $73b9691e04761700$var$JulianDate(2457204, 43236.0, (0, $134462e760c5c083$export$2e2bcd8739ae039).TAI), 36),\n new (0, $97869fccaa735547$export$2e2bcd8739ae039)(new $73b9691e04761700$var$JulianDate(2457754, 43237.0, (0, $134462e760c5c083$export$2e2bcd8739ae039).TAI), 37)\n];\nvar $73b9691e04761700$export$2e2bcd8739ae039 = $73b9691e04761700$var$JulianDate;\n\n\n\nvar $f3b7c43a7f0c8e85$exports = {};\n\n\n\n/*!\n * URI.js - Mutating URLs\n *\n * Version: 1.19.11\n *\n * Author: Rodney Rehm\n * Web: http://medialize.github.io/URI.js/\n *\n * Licensed under\n * MIT License http://www.opensource.org/licenses/mit-license\n *\n */ (function(root, factory) {\n \"use strict\";\n // https://github.com/umdjs/umd/blob/master/returnExports.js\n if (0, $f3b7c43a7f0c8e85$exports) // Node\n $f3b7c43a7f0c8e85$exports = factory((parcelRequire(\"3hCk4\")), (parcelRequire(\"2Nl4L\")), (parcelRequire(\"3PMOQ\")));\n else if (typeof define === \"function\" && define.amd) // AMD. Register as an anonymous module.\n define([\n \"./punycode\",\n \"./IPv6\",\n \"./SecondLevelDomains\"\n ], factory);\n else // Browser globals (root is window)\n root.URI = factory(root.punycode, root.IPv6, root.SecondLevelDomains, root);\n})($f3b7c43a7f0c8e85$exports, function(punycode, IPv6, SLD, root) {\n \"use strict\";\n /*global location, escape, unescape */ // FIXME: v2.0.0 renamce non-camelCase properties to uppercase\n /*jshint camelcase: false */ // save current URI variable, if any\n var _URI = root && root.URI;\n function URI(url, base) {\n var _urlSupplied = arguments.length >= 1;\n var _baseSupplied = arguments.length >= 2;\n // Allow instantiation without the 'new' keyword\n if (!(this instanceof URI)) {\n if (_urlSupplied) {\n if (_baseSupplied) return new URI(url, base);\n return new URI(url);\n }\n return new URI();\n }\n if (url === undefined) {\n if (_urlSupplied) throw new TypeError(\"undefined is not a valid argument for URI\");\n if (typeof location !== \"undefined\") url = location.href + \"\";\n else url = \"\";\n }\n if (url === null) {\n if (_urlSupplied) throw new TypeError(\"null is not a valid argument for URI\");\n }\n this.href(url);\n // resolve to base according to http://dvcs.w3.org/hg/url/raw-file/tip/Overview.html#constructor\n if (base !== undefined) return this.absoluteTo(base);\n return this;\n }\n function isInteger(value) {\n return /^[0-9]+$/.test(value);\n }\n URI.version = \"1.19.11\";\n var p = URI.prototype;\n var hasOwn = Object.prototype.hasOwnProperty;\n function escapeRegEx(string) {\n // https://github.com/medialize/URI.js/commit/85ac21783c11f8ccab06106dba9735a31a86924d#commitcomment-821963\n return string.replace(/([.*+?^=!:${}()|[\\]\\/\\\\])/g, \"\\\\$1\");\n }\n function getType(value) {\n // IE8 doesn't return [Object Undefined] but [Object Object] for undefined value\n if (value === undefined) return \"Undefined\";\n return String(Object.prototype.toString.call(value)).slice(8, -1);\n }\n function isArray(obj) {\n return getType(obj) === \"Array\";\n }\n function filterArrayValues(data, value) {\n var lookup = {};\n var i, length;\n if (getType(value) === \"RegExp\") lookup = null;\n else if (isArray(value)) for(i = 0, length = value.length; i < length; i++)lookup[value[i]] = true;\n else lookup[value] = true;\n for(i = 0, length = data.length; i < length; i++){\n /*jshint laxbreak: true */ var _match = lookup && lookup[data[i]] !== undefined || !lookup && value.test(data[i]);\n /*jshint laxbreak: false */ if (_match) {\n data.splice(i, 1);\n length--;\n i--;\n }\n }\n return data;\n }\n function arrayContains(list, value) {\n var i, length;\n // value may be string, number, array, regexp\n if (isArray(value)) {\n // Note: this can be optimized to O(n) (instead of current O(m * n))\n for(i = 0, length = value.length; i < length; i++){\n if (!arrayContains(list, value[i])) return false;\n }\n return true;\n }\n var _type = getType(value);\n for(i = 0, length = list.length; i < length; i++){\n if (_type === \"RegExp\") {\n if (typeof list[i] === \"string\" && list[i].match(value)) return true;\n } else if (list[i] === value) return true;\n }\n return false;\n }\n function arraysEqual(one, two) {\n if (!isArray(one) || !isArray(two)) return false;\n // arrays can't be equal if they have different amount of content\n if (one.length !== two.length) return false;\n one.sort();\n two.sort();\n for(var i = 0, l = one.length; i < l; i++){\n if (one[i] !== two[i]) return false;\n }\n return true;\n }\n function trimSlashes(text) {\n var trim_expression = /^\\/+|\\/+$/g;\n return text.replace(trim_expression, \"\");\n }\n URI._parts = function() {\n return {\n protocol: null,\n username: null,\n password: null,\n hostname: null,\n urn: null,\n port: null,\n path: null,\n query: null,\n fragment: null,\n // state\n preventInvalidHostname: URI.preventInvalidHostname,\n duplicateQueryParameters: URI.duplicateQueryParameters,\n escapeQuerySpace: URI.escapeQuerySpace\n };\n };\n // state: throw on invalid hostname\n // see https://github.com/medialize/URI.js/pull/345\n // and https://github.com/medialize/URI.js/issues/354\n URI.preventInvalidHostname = false;\n // state: allow duplicate query parameters (a=1&a=1)\n URI.duplicateQueryParameters = false;\n // state: replaces + with %20 (space in query strings)\n URI.escapeQuerySpace = true;\n // static properties\n URI.protocol_expression = /^[a-z][a-z0-9.+-]*$/i;\n URI.idn_expression = /[^a-z0-9\\._-]/i;\n URI.punycode_expression = /(xn--)/i;\n // well, 333.444.555.666 matches, but it sure ain't no IPv4 - do we care?\n URI.ip4_expression = /^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}$/;\n // credits to Rich Brown\n // source: http://forums.intermapper.com/viewtopic.php?p=1096#1096\n // specification: http://www.ietf.org/rfc/rfc4291.txt\n URI.ip6_expression = /^\\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:)))(%.+)?\\s*$/;\n // expression used is \"gruber revised\" (@gruber v2) determined to be the\n // best solution in a regex-golf we did a couple of ages ago at\n // * http://mathiasbynens.be/demo/url-regex\n // * http://rodneyrehm.de/t/url-regex.html\n URI.find_uri_expression = /\\b((?:[a-z][\\w-]+:(?:\\/{1,3}|[a-z0-9%])|www\\d{0,3}[.]|[a-z0-9.\\-]+[.][a-z]{2,4}\\/)(?:[^\\s()<>]+|\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\))+(?:\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\)|[^\\s`!()\\[\\]{};:'\".,<>?«»“”‘’]))/ig;\n URI.findUri = {\n // valid \"scheme://\" or \"www.\"\n start: /\\b(?:([a-z][a-z0-9.+-]*:\\/\\/)|www\\.)/gi,\n // everything up to the next whitespace\n end: /[\\s\\r\\n]|$/,\n // trim trailing punctuation captured by end RegExp\n trim: /[`!()\\[\\]{};:'\".,<>?«»“”„‘’]+$/,\n // balanced parens inclusion (), [], {}, <>\n parens: /(\\([^\\)]*\\)|\\[[^\\]]*\\]|\\{[^}]*\\}|<[^>]*>)/g\n };\n URI.leading_whitespace_expression = /^[\\x00-\\x20\\u00a0\\u1680\\u2000-\\u200a\\u2028\\u2029\\u202f\\u205f\\u3000\\ufeff]+/;\n // https://infra.spec.whatwg.org/#ascii-tab-or-newline\n URI.ascii_tab_whitespace = /[\\u0009\\u000A\\u000D]+/g;\n // http://www.iana.org/assignments/uri-schemes.html\n // http://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers#Well-known_ports\n URI.defaultPorts = {\n http: \"80\",\n https: \"443\",\n ftp: \"21\",\n gopher: \"70\",\n ws: \"80\",\n wss: \"443\"\n };\n // list of protocols which always require a hostname\n URI.hostProtocols = [\n \"http\",\n \"https\"\n ];\n // allowed hostname characters according to RFC 3986\n // ALPHA DIGIT \"-\" \".\" \"_\" \"~\" \"!\" \"$\" \"&\" \"'\" \"(\" \")\" \"*\" \"+\" \",\" \";\" \"=\" %encoded\n // I've never seen a (non-IDN) hostname other than: ALPHA DIGIT . - _\n URI.invalid_hostname_characters = /[^a-zA-Z0-9\\.\\-:_]/;\n // map DOM Elements to their URI attribute\n URI.domAttributes = {\n \"a\": \"href\",\n \"blockquote\": \"cite\",\n \"link\": \"href\",\n \"base\": \"href\",\n \"script\": \"src\",\n \"form\": \"action\",\n \"img\": \"src\",\n \"area\": \"href\",\n \"iframe\": \"src\",\n \"embed\": \"src\",\n \"source\": \"src\",\n \"track\": \"src\",\n \"input\": \"src\",\n \"audio\": \"src\",\n \"video\": \"src\"\n };\n URI.getDomAttribute = function(node) {\n if (!node || !node.nodeName) return undefined;\n var nodeName = node.nodeName.toLowerCase();\n // should only expose src for type=\"image\"\n if (nodeName === \"input\" && node.type !== \"image\") return undefined;\n return URI.domAttributes[nodeName];\n };\n function escapeForDumbFirefox36(value) {\n // https://github.com/medialize/URI.js/issues/91\n return escape(value);\n }\n // encoding / decoding according to RFC3986\n function strictEncodeURIComponent(string) {\n // see https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/encodeURIComponent\n return encodeURIComponent(string).replace(/[!'()*]/g, escapeForDumbFirefox36).replace(/\\*/g, \"%2A\");\n }\n URI.encode = strictEncodeURIComponent;\n URI.decode = decodeURIComponent;\n URI.iso8859 = function() {\n URI.encode = escape;\n URI.decode = unescape;\n };\n URI.unicode = function() {\n URI.encode = strictEncodeURIComponent;\n URI.decode = decodeURIComponent;\n };\n URI.characters = {\n pathname: {\n encode: {\n // RFC3986 2.1: For consistency, URI producers and normalizers should\n // use uppercase hexadecimal digits for all percent-encodings.\n expression: /%(24|26|2B|2C|3B|3D|3A|40)/ig,\n map: {\n // -._~!'()*\n \"%24\": \"$\",\n \"%26\": \"&\",\n \"%2B\": \"+\",\n \"%2C\": \",\",\n \"%3B\": \";\",\n \"%3D\": \"=\",\n \"%3A\": \":\",\n \"%40\": \"@\"\n }\n },\n decode: {\n expression: /[\\/\\?#]/g,\n map: {\n \"/\": \"%2F\",\n \"?\": \"%3F\",\n \"#\": \"%23\"\n }\n }\n },\n reserved: {\n encode: {\n // RFC3986 2.1: For consistency, URI producers and normalizers should\n // use uppercase hexadecimal digits for all percent-encodings.\n expression: /%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/ig,\n map: {\n // gen-delims\n \"%3A\": \":\",\n \"%2F\": \"/\",\n \"%3F\": \"?\",\n \"%23\": \"#\",\n \"%5B\": \"[\",\n \"%5D\": \"]\",\n \"%40\": \"@\",\n // sub-delims\n \"%21\": \"!\",\n \"%24\": \"$\",\n \"%26\": \"&\",\n \"%27\": \"'\",\n \"%28\": \"(\",\n \"%29\": \")\",\n \"%2A\": \"*\",\n \"%2B\": \"+\",\n \"%2C\": \",\",\n \"%3B\": \";\",\n \"%3D\": \"=\"\n }\n }\n },\n urnpath: {\n // The characters under `encode` are the characters called out by RFC 2141 as being acceptable\n // for usage in a URN. RFC2141 also calls out \"-\", \".\", and \"_\" as acceptable characters, but\n // these aren't encoded by encodeURIComponent, so we don't have to call them out here. Also\n // note that the colon character is not featured in the encoding map; this is because URI.js\n // gives the colons in URNs semantic meaning as the delimiters of path segements, and so it\n // should not appear unencoded in a segment itself.\n // See also the note above about RFC3986 and capitalalized hex digits.\n encode: {\n expression: /%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/ig,\n map: {\n \"%21\": \"!\",\n \"%24\": \"$\",\n \"%27\": \"'\",\n \"%28\": \"(\",\n \"%29\": \")\",\n \"%2A\": \"*\",\n \"%2B\": \"+\",\n \"%2C\": \",\",\n \"%3B\": \";\",\n \"%3D\": \"=\",\n \"%40\": \"@\"\n }\n },\n // These characters are the characters called out by RFC2141 as \"reserved\" characters that\n // should never appear in a URN, plus the colon character (see note above).\n decode: {\n expression: /[\\/\\?#:]/g,\n map: {\n \"/\": \"%2F\",\n \"?\": \"%3F\",\n \"#\": \"%23\",\n \":\": \"%3A\"\n }\n }\n }\n };\n URI.encodeQuery = function(string, escapeQuerySpace) {\n var escaped = URI.encode(string + \"\");\n if (escapeQuerySpace === undefined) escapeQuerySpace = URI.escapeQuerySpace;\n return escapeQuerySpace ? escaped.replace(/%20/g, \"+\") : escaped;\n };\n URI.decodeQuery = function(string, escapeQuerySpace) {\n string += \"\";\n if (escapeQuerySpace === undefined) escapeQuerySpace = URI.escapeQuerySpace;\n try {\n return URI.decode(escapeQuerySpace ? string.replace(/\\+/g, \"%20\") : string);\n } catch (e) {\n // we're not going to mess with weird encodings,\n // give up and return the undecoded original string\n // see https://github.com/medialize/URI.js/issues/87\n // see https://github.com/medialize/URI.js/issues/92\n return string;\n }\n };\n // generate encode/decode path functions\n var _parts = {\n \"encode\": \"encode\",\n \"decode\": \"decode\"\n };\n var _part;\n var generateAccessor = function(_group, _part) {\n return function(string) {\n try {\n return URI[_part](string + \"\").replace(URI.characters[_group][_part].expression, function(c) {\n return URI.characters[_group][_part].map[c];\n });\n } catch (e) {\n // we're not going to mess with weird encodings,\n // give up and return the undecoded original string\n // see https://github.com/medialize/URI.js/issues/87\n // see https://github.com/medialize/URI.js/issues/92\n return string;\n }\n };\n };\n for(_part in _parts){\n URI[_part + \"PathSegment\"] = generateAccessor(\"pathname\", _parts[_part]);\n URI[_part + \"UrnPathSegment\"] = generateAccessor(\"urnpath\", _parts[_part]);\n }\n var generateSegmentedPathFunction = function(_sep, _codingFuncName, _innerCodingFuncName) {\n return function(string) {\n // Why pass in names of functions, rather than the function objects themselves? The\n // definitions of some functions (but in particular, URI.decode) will occasionally change due\n // to URI.js having ISO8859 and Unicode modes. Passing in the name and getting it will ensure\n // that the functions we use here are \"fresh\".\n var actualCodingFunc;\n if (!_innerCodingFuncName) actualCodingFunc = URI[_codingFuncName];\n else actualCodingFunc = function(string) {\n return URI[_codingFuncName](URI[_innerCodingFuncName](string));\n };\n var segments = (string + \"\").split(_sep);\n for(var i = 0, length = segments.length; i < length; i++)segments[i] = actualCodingFunc(segments[i]);\n return segments.join(_sep);\n };\n };\n // This takes place outside the above loop because we don't want, e.g., encodeUrnPath functions.\n URI.decodePath = generateSegmentedPathFunction(\"/\", \"decodePathSegment\");\n URI.decodeUrnPath = generateSegmentedPathFunction(\":\", \"decodeUrnPathSegment\");\n URI.recodePath = generateSegmentedPathFunction(\"/\", \"encodePathSegment\", \"decode\");\n URI.recodeUrnPath = generateSegmentedPathFunction(\":\", \"encodeUrnPathSegment\", \"decode\");\n URI.encodeReserved = generateAccessor(\"reserved\", \"encode\");\n URI.parse = function(string, parts) {\n var pos;\n if (!parts) parts = {\n preventInvalidHostname: URI.preventInvalidHostname\n };\n string = string.replace(URI.leading_whitespace_expression, \"\");\n // https://infra.spec.whatwg.org/#ascii-tab-or-newline\n string = string.replace(URI.ascii_tab_whitespace, \"\");\n // [protocol\"://\"[username[\":\"password]\"@\"]hostname[\":\"port]\"/\"?][path][\"?\"querystring][\"#\"fragment]\n // extract fragment\n pos = string.indexOf(\"#\");\n if (pos > -1) {\n // escaping?\n parts.fragment = string.substring(pos + 1) || null;\n string = string.substring(0, pos);\n }\n // extract query\n pos = string.indexOf(\"?\");\n if (pos > -1) {\n // escaping?\n parts.query = string.substring(pos + 1) || null;\n string = string.substring(0, pos);\n }\n // slashes and backslashes have lost all meaning for the web protocols (https, http, wss, ws)\n string = string.replace(/^(https?|ftp|wss?)?:+[/\\\\]*/i, \"$1://\");\n // slashes and backslashes have lost all meaning for scheme relative URLs\n string = string.replace(/^[/\\\\]{2,}/i, \"//\");\n // extract protocol\n if (string.substring(0, 2) === \"//\") {\n // relative-scheme\n parts.protocol = null;\n string = string.substring(2);\n // extract \"user:pass@host:port\"\n string = URI.parseAuthority(string, parts);\n } else {\n pos = string.indexOf(\":\");\n if (pos > -1) {\n parts.protocol = string.substring(0, pos) || null;\n if (parts.protocol && !parts.protocol.match(URI.protocol_expression)) // : may be within the path\n parts.protocol = undefined;\n else if (string.substring(pos + 1, pos + 3).replace(/\\\\/g, \"/\") === \"//\") {\n string = string.substring(pos + 3);\n // extract \"user:pass@host:port\"\n string = URI.parseAuthority(string, parts);\n } else {\n string = string.substring(pos + 1);\n parts.urn = true;\n }\n }\n }\n // what's left must be the path\n parts.path = string;\n // and we're done\n return parts;\n };\n URI.parseHost = function(string, parts) {\n if (!string) string = \"\";\n // Copy chrome, IE, opera backslash-handling behavior.\n // Back slashes before the query string get converted to forward slashes\n // See: https://github.com/joyent/node/blob/386fd24f49b0e9d1a8a076592a404168faeecc34/lib/url.js#L115-L124\n // See: https://code.google.com/p/chromium/issues/detail?id=25916\n // https://github.com/medialize/URI.js/pull/233\n string = string.replace(/\\\\/g, \"/\");\n // extract host:port\n var pos = string.indexOf(\"/\");\n var bracketPos;\n var t;\n if (pos === -1) pos = string.length;\n if (string.charAt(0) === \"[\") {\n // IPv6 host - http://tools.ietf.org/html/draft-ietf-6man-text-addr-representation-04#section-6\n // I claim most client software breaks on IPv6 anyways. To simplify things, URI only accepts\n // IPv6+port in the format [2001:db8::1]:80 (for the time being)\n bracketPos = string.indexOf(\"]\");\n parts.hostname = string.substring(1, bracketPos) || null;\n parts.port = string.substring(bracketPos + 2, pos) || null;\n if (parts.port === \"/\") parts.port = null;\n } else {\n var firstColon = string.indexOf(\":\");\n var firstSlash = string.indexOf(\"/\");\n var nextColon = string.indexOf(\":\", firstColon + 1);\n if (nextColon !== -1 && (firstSlash === -1 || nextColon < firstSlash)) {\n // IPv6 host contains multiple colons - but no port\n // this notation is actually not allowed by RFC 3986, but we're a liberal parser\n parts.hostname = string.substring(0, pos) || null;\n parts.port = null;\n } else {\n t = string.substring(0, pos).split(\":\");\n parts.hostname = t[0] || null;\n parts.port = t[1] || null;\n }\n }\n if (parts.hostname && string.substring(pos).charAt(0) !== \"/\") {\n pos++;\n string = \"/\" + string;\n }\n if (parts.preventInvalidHostname) URI.ensureValidHostname(parts.hostname, parts.protocol);\n if (parts.port) URI.ensureValidPort(parts.port);\n return string.substring(pos) || \"/\";\n };\n URI.parseAuthority = function(string, parts) {\n string = URI.parseUserinfo(string, parts);\n return URI.parseHost(string, parts);\n };\n URI.parseUserinfo = function(string, parts) {\n // extract username:password\n var _string = string;\n var firstBackSlash = string.indexOf(\"\\\\\");\n if (firstBackSlash !== -1) string = string.replace(/\\\\/g, \"/\");\n var firstSlash = string.indexOf(\"/\");\n var pos = string.lastIndexOf(\"@\", firstSlash > -1 ? firstSlash : string.length - 1);\n var t;\n // authority@ must come before /path or \\path\n if (pos > -1 && (firstSlash === -1 || pos < firstSlash)) {\n t = string.substring(0, pos).split(\":\");\n parts.username = t[0] ? URI.decode(t[0]) : null;\n t.shift();\n parts.password = t[0] ? URI.decode(t.join(\":\")) : null;\n string = _string.substring(pos + 1);\n } else {\n parts.username = null;\n parts.password = null;\n }\n return string;\n };\n URI.parseQuery = function(string, escapeQuerySpace) {\n if (!string) return {};\n // throw out the funky business - \"?\"[name\"=\"value\"&\"]+\n string = string.replace(/&+/g, \"&\").replace(/^\\?*&*|&+$/g, \"\");\n if (!string) return {};\n var items = {};\n var splits = string.split(\"&\");\n var length = splits.length;\n var v, name, value;\n for(var i = 0; i < length; i++){\n v = splits[i].split(\"=\");\n name = URI.decodeQuery(v.shift(), escapeQuerySpace);\n // no \"=\" is null according to http://dvcs.w3.org/hg/url/raw-file/tip/Overview.html#collect-url-parameters\n value = v.length ? URI.decodeQuery(v.join(\"=\"), escapeQuerySpace) : null;\n if (name === \"__proto__\") continue;\n else if (hasOwn.call(items, name)) {\n if (typeof items[name] === \"string\" || items[name] === null) items[name] = [\n items[name]\n ];\n items[name].push(value);\n } else items[name] = value;\n }\n return items;\n };\n URI.build = function(parts) {\n var t = \"\";\n var requireAbsolutePath = false;\n if (parts.protocol) t += parts.protocol + \":\";\n if (!parts.urn && (t || parts.hostname)) {\n t += \"//\";\n requireAbsolutePath = true;\n }\n t += URI.buildAuthority(parts) || \"\";\n if (typeof parts.path === \"string\") {\n if (parts.path.charAt(0) !== \"/\" && requireAbsolutePath) t += \"/\";\n t += parts.path;\n }\n if (typeof parts.query === \"string\" && parts.query) t += \"?\" + parts.query;\n if (typeof parts.fragment === \"string\" && parts.fragment) t += \"#\" + parts.fragment;\n return t;\n };\n URI.buildHost = function(parts) {\n var t = \"\";\n if (!parts.hostname) return \"\";\n else if (URI.ip6_expression.test(parts.hostname)) t += \"[\" + parts.hostname + \"]\";\n else t += parts.hostname;\n if (parts.port) t += \":\" + parts.port;\n return t;\n };\n URI.buildAuthority = function(parts) {\n return URI.buildUserinfo(parts) + URI.buildHost(parts);\n };\n URI.buildUserinfo = function(parts) {\n var t = \"\";\n if (parts.username) t += URI.encode(parts.username);\n if (parts.password) t += \":\" + URI.encode(parts.password);\n if (t) t += \"@\";\n return t;\n };\n URI.buildQuery = function(data, duplicateQueryParameters, escapeQuerySpace) {\n // according to http://tools.ietf.org/html/rfc3986 or http://labs.apache.org/webarch/uri/rfc/rfc3986.html\n // being »-._~!$&'()*+,;=:@/?« %HEX and alnum are allowed\n // the RFC explicitly states ?/foo being a valid use case, no mention of parameter syntax!\n // URI.js treats the query string as being application/x-www-form-urlencoded\n // see http://www.w3.org/TR/REC-html40/interact/forms.html#form-content-type\n var t = \"\";\n var unique, key, i, length;\n for(key in data){\n if (key === \"__proto__\") continue;\n else if (hasOwn.call(data, key)) {\n if (isArray(data[key])) {\n unique = {};\n for(i = 0, length = data[key].length; i < length; i++)if (data[key][i] !== undefined && unique[data[key][i] + \"\"] === undefined) {\n t += \"&\" + URI.buildQueryParameter(key, data[key][i], escapeQuerySpace);\n if (duplicateQueryParameters !== true) unique[data[key][i] + \"\"] = true;\n }\n } else if (data[key] !== undefined) t += \"&\" + URI.buildQueryParameter(key, data[key], escapeQuerySpace);\n }\n }\n return t.substring(1);\n };\n URI.buildQueryParameter = function(name, value, escapeQuerySpace) {\n // http://www.w3.org/TR/REC-html40/interact/forms.html#form-content-type -- application/x-www-form-urlencoded\n // don't append \"=\" for null values, according to http://dvcs.w3.org/hg/url/raw-file/tip/Overview.html#url-parameter-serialization\n return URI.encodeQuery(name, escapeQuerySpace) + (value !== null ? \"=\" + URI.encodeQuery(value, escapeQuerySpace) : \"\");\n };\n URI.addQuery = function(data, name, value) {\n if (typeof name === \"object\") {\n for(var key in name)if (hasOwn.call(name, key)) URI.addQuery(data, key, name[key]);\n } else if (typeof name === \"string\") {\n if (data[name] === undefined) {\n data[name] = value;\n return;\n } else if (typeof data[name] === \"string\") data[name] = [\n data[name]\n ];\n if (!isArray(value)) value = [\n value\n ];\n data[name] = (data[name] || []).concat(value);\n } else throw new TypeError(\"URI.addQuery() accepts an object, string as the name parameter\");\n };\n URI.setQuery = function(data, name, value) {\n if (typeof name === \"object\") {\n for(var key in name)if (hasOwn.call(name, key)) URI.setQuery(data, key, name[key]);\n } else if (typeof name === \"string\") data[name] = value === undefined ? null : value;\n else throw new TypeError(\"URI.setQuery() accepts an object, string as the name parameter\");\n };\n URI.removeQuery = function(data, name, value) {\n var i, length, key;\n if (isArray(name)) for(i = 0, length = name.length; i < length; i++)data[name[i]] = undefined;\n else if (getType(name) === \"RegExp\") {\n for(key in data)if (name.test(key)) data[key] = undefined;\n } else if (typeof name === \"object\") {\n for(key in name)if (hasOwn.call(name, key)) URI.removeQuery(data, key, name[key]);\n } else if (typeof name === \"string\") {\n if (value !== undefined) {\n if (getType(value) === \"RegExp\") {\n if (!isArray(data[name]) && value.test(data[name])) data[name] = undefined;\n else data[name] = filterArrayValues(data[name], value);\n } else if (data[name] === String(value) && (!isArray(value) || value.length === 1)) data[name] = undefined;\n else if (isArray(data[name])) data[name] = filterArrayValues(data[name], value);\n } else data[name] = undefined;\n } else throw new TypeError(\"URI.removeQuery() accepts an object, string, RegExp as the first parameter\");\n };\n URI.hasQuery = function(data, name, value, withinArray) {\n switch(getType(name)){\n case \"String\":\n break;\n case \"RegExp\":\n for(var key in data)if (hasOwn.call(data, key)) {\n if (name.test(key) && (value === undefined || URI.hasQuery(data, key, value))) return true;\n }\n return false;\n case \"Object\":\n for(var _key in name)if (hasOwn.call(name, _key)) {\n if (!URI.hasQuery(data, _key, name[_key])) return false;\n }\n return true;\n default:\n throw new TypeError(\"URI.hasQuery() accepts a string, regular expression or object as the name parameter\");\n }\n switch(getType(value)){\n case \"Undefined\":\n // true if exists (but may be empty)\n return name in data; // data[name] !== undefined;\n case \"Boolean\":\n // true if exists and non-empty\n var _booly = Boolean(isArray(data[name]) ? data[name].length : data[name]);\n return value === _booly;\n case \"Function\":\n // allow complex comparison\n return !!value(data[name], name, data);\n case \"Array\":\n if (!isArray(data[name])) return false;\n var op = withinArray ? arrayContains : arraysEqual;\n return op(data[name], value);\n case \"RegExp\":\n if (!isArray(data[name])) return Boolean(data[name] && data[name].match(value));\n if (!withinArray) return false;\n return arrayContains(data[name], value);\n case \"Number\":\n value = String(value);\n /* falls through */ case \"String\":\n if (!isArray(data[name])) return data[name] === value;\n if (!withinArray) return false;\n return arrayContains(data[name], value);\n default:\n throw new TypeError(\"URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter\");\n }\n };\n URI.joinPaths = function() {\n var input = [];\n var segments = [];\n var nonEmptySegments = 0;\n for(var i = 0; i < arguments.length; i++){\n var url = new URI(arguments[i]);\n input.push(url);\n var _segments = url.segment();\n for(var s = 0; s < _segments.length; s++){\n if (typeof _segments[s] === \"string\") segments.push(_segments[s]);\n if (_segments[s]) nonEmptySegments++;\n }\n }\n if (!segments.length || !nonEmptySegments) return new URI(\"\");\n var uri = new URI(\"\").segment(segments);\n if (input[0].path() === \"\" || input[0].path().slice(0, 1) === \"/\") uri.path(\"/\" + uri.path());\n return uri.normalize();\n };\n URI.commonPath = function(one, two) {\n var length = Math.min(one.length, two.length);\n var pos;\n // find first non-matching character\n for(pos = 0; pos < length; pos++)if (one.charAt(pos) !== two.charAt(pos)) {\n pos--;\n break;\n }\n if (pos < 1) return one.charAt(0) === two.charAt(0) && one.charAt(0) === \"/\" ? \"/\" : \"\";\n // revert to last /\n if (one.charAt(pos) !== \"/\" || two.charAt(pos) !== \"/\") pos = one.substring(0, pos).lastIndexOf(\"/\");\n return one.substring(0, pos + 1);\n };\n URI.withinString = function(string, callback, options) {\n options || (options = {});\n var _start = options.start || URI.findUri.start;\n var _end = options.end || URI.findUri.end;\n var _trim = options.trim || URI.findUri.trim;\n var _parens = options.parens || URI.findUri.parens;\n var _attributeOpen = /[a-z0-9-]=[\"']?$/i;\n _start.lastIndex = 0;\n while(true){\n var match = _start.exec(string);\n if (!match) break;\n var start = match.index;\n if (options.ignoreHtml) {\n // attribut(e=[\"']?$)\n var attributeOpen = string.slice(Math.max(start - 3, 0), start);\n if (attributeOpen && _attributeOpen.test(attributeOpen)) continue;\n }\n var end = start + string.slice(start).search(_end);\n var slice = string.slice(start, end);\n // make sure we include well balanced parens\n var parensEnd = -1;\n while(true){\n var parensMatch = _parens.exec(slice);\n if (!parensMatch) break;\n var parensMatchEnd = parensMatch.index + parensMatch[0].length;\n parensEnd = Math.max(parensEnd, parensMatchEnd);\n }\n if (parensEnd > -1) slice = slice.slice(0, parensEnd) + slice.slice(parensEnd).replace(_trim, \"\");\n else slice = slice.replace(_trim, \"\");\n if (slice.length <= match[0].length) continue;\n if (options.ignore && options.ignore.test(slice)) continue;\n end = start + slice.length;\n var result = callback(slice, start, end, string);\n if (result === undefined) {\n _start.lastIndex = end;\n continue;\n }\n result = String(result);\n string = string.slice(0, start) + result + string.slice(end);\n _start.lastIndex = start + result.length;\n }\n _start.lastIndex = 0;\n return string;\n };\n URI.ensureValidHostname = function(v, protocol) {\n // Theoretically URIs allow percent-encoding in Hostnames (according to RFC 3986)\n // they are not part of DNS and therefore ignored by URI.js\n var hasHostname = !!v; // not null and not an empty string\n var hasProtocol = !!protocol;\n var rejectEmptyHostname = false;\n if (hasProtocol) rejectEmptyHostname = arrayContains(URI.hostProtocols, protocol);\n if (rejectEmptyHostname && !hasHostname) throw new TypeError(\"Hostname cannot be empty, if protocol is \" + protocol);\n else if (v && v.match(URI.invalid_hostname_characters)) {\n // test punycode\n if (!punycode) throw new TypeError('Hostname \"' + v + '\" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');\n if (punycode.toASCII(v).match(URI.invalid_hostname_characters)) throw new TypeError('Hostname \"' + v + '\" contains characters other than [A-Z0-9.-:_]');\n }\n };\n URI.ensureValidPort = function(v) {\n if (!v) return;\n var port = Number(v);\n if (isInteger(port) && port > 0 && port < 65536) return;\n throw new TypeError('Port \"' + v + '\" is not a valid port');\n };\n // noConflict\n URI.noConflict = function(removeAll) {\n if (removeAll) {\n var unconflicted = {\n URI: this.noConflict()\n };\n if (root.URITemplate && typeof root.URITemplate.noConflict === \"function\") unconflicted.URITemplate = root.URITemplate.noConflict();\n if (root.IPv6 && typeof root.IPv6.noConflict === \"function\") unconflicted.IPv6 = root.IPv6.noConflict();\n if (root.SecondLevelDomains && typeof root.SecondLevelDomains.noConflict === \"function\") unconflicted.SecondLevelDomains = root.SecondLevelDomains.noConflict();\n return unconflicted;\n } else if (root.URI === this) root.URI = _URI;\n return this;\n };\n p.build = function(deferBuild) {\n if (deferBuild === true) this._deferred_build = true;\n else if (deferBuild === undefined || this._deferred_build) {\n this._string = URI.build(this._parts);\n this._deferred_build = false;\n }\n return this;\n };\n p.clone = function() {\n return new URI(this);\n };\n p.valueOf = p.toString = function() {\n return this.build(false)._string;\n };\n function generateSimpleAccessor(_part) {\n return function(v, build) {\n if (v === undefined) return this._parts[_part] || \"\";\n else {\n this._parts[_part] = v || null;\n this.build(!build);\n return this;\n }\n };\n }\n function generatePrefixAccessor(_part, _key) {\n return function(v, build) {\n if (v === undefined) return this._parts[_part] || \"\";\n else {\n if (v !== null) {\n v = v + \"\";\n if (v.charAt(0) === _key) v = v.substring(1);\n }\n this._parts[_part] = v;\n this.build(!build);\n return this;\n }\n };\n }\n p.protocol = generateSimpleAccessor(\"protocol\");\n p.username = generateSimpleAccessor(\"username\");\n p.password = generateSimpleAccessor(\"password\");\n p.hostname = generateSimpleAccessor(\"hostname\");\n p.port = generateSimpleAccessor(\"port\");\n p.query = generatePrefixAccessor(\"query\", \"?\");\n p.fragment = generatePrefixAccessor(\"fragment\", \"#\");\n p.search = function(v, build) {\n var t = this.query(v, build);\n return typeof t === \"string\" && t.length ? \"?\" + t : t;\n };\n p.hash = function(v, build) {\n var t = this.fragment(v, build);\n return typeof t === \"string\" && t.length ? \"#\" + t : t;\n };\n p.pathname = function(v, build) {\n if (v === undefined || v === true) {\n var res = this._parts.path || (this._parts.hostname ? \"/\" : \"\");\n return v ? (this._parts.urn ? URI.decodeUrnPath : URI.decodePath)(res) : res;\n } else {\n if (this._parts.urn) this._parts.path = v ? URI.recodeUrnPath(v) : \"\";\n else this._parts.path = v ? URI.recodePath(v) : \"/\";\n this.build(!build);\n return this;\n }\n };\n p.path = p.pathname;\n p.href = function(href, build) {\n var key;\n if (href === undefined) return this.toString();\n this._string = \"\";\n this._parts = URI._parts();\n var _URI = href instanceof URI;\n var _object = typeof href === \"object\" && (href.hostname || href.path || href.pathname);\n if (href.nodeName) {\n var attribute = URI.getDomAttribute(href);\n href = href[attribute] || \"\";\n _object = false;\n }\n // window.location is reported to be an object, but it's not the sort\n // of object we're looking for:\n // * location.protocol ends with a colon\n // * location.query != object.search\n // * location.hash != object.fragment\n // simply serializing the unknown object should do the trick\n // (for location, not for everything...)\n if (!_URI && _object && href.pathname !== undefined) href = href.toString();\n if (typeof href === \"string\" || href instanceof String) this._parts = URI.parse(String(href), this._parts);\n else if (_URI || _object) {\n var src = _URI ? href._parts : href;\n for(key in src){\n if (key === \"query\") continue;\n if (hasOwn.call(this._parts, key)) this._parts[key] = src[key];\n }\n if (src.query) this.query(src.query, false);\n } else throw new TypeError(\"invalid input\");\n this.build(!build);\n return this;\n };\n // identification accessors\n p.is = function(what) {\n var ip = false;\n var ip4 = false;\n var ip6 = false;\n var name = false;\n var sld = false;\n var idn = false;\n var punycode = false;\n var relative = !this._parts.urn;\n if (this._parts.hostname) {\n relative = false;\n ip4 = URI.ip4_expression.test(this._parts.hostname);\n ip6 = URI.ip6_expression.test(this._parts.hostname);\n ip = ip4 || ip6;\n name = !ip;\n sld = name && SLD && SLD.has(this._parts.hostname);\n idn = name && URI.idn_expression.test(this._parts.hostname);\n punycode = name && URI.punycode_expression.test(this._parts.hostname);\n }\n switch(what.toLowerCase()){\n case \"relative\":\n return relative;\n case \"absolute\":\n return !relative;\n // hostname identification\n case \"domain\":\n case \"name\":\n return name;\n case \"sld\":\n return sld;\n case \"ip\":\n return ip;\n case \"ip4\":\n case \"ipv4\":\n case \"inet4\":\n return ip4;\n case \"ip6\":\n case \"ipv6\":\n case \"inet6\":\n return ip6;\n case \"idn\":\n return idn;\n case \"url\":\n return !this._parts.urn;\n case \"urn\":\n return !!this._parts.urn;\n case \"punycode\":\n return punycode;\n }\n return null;\n };\n // component specific input validation\n var _protocol = p.protocol;\n var _port = p.port;\n var _hostname = p.hostname;\n p.protocol = function(v, build) {\n if (v) {\n // accept trailing ://\n v = v.replace(/:(\\/\\/)?$/, \"\");\n if (!v.match(URI.protocol_expression)) throw new TypeError('Protocol \"' + v + \"\\\" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]\");\n }\n return _protocol.call(this, v, build);\n };\n p.scheme = p.protocol;\n p.port = function(v, build) {\n if (this._parts.urn) return v === undefined ? \"\" : this;\n if (v !== undefined) {\n if (v === 0) v = null;\n if (v) {\n v += \"\";\n if (v.charAt(0) === \":\") v = v.substring(1);\n URI.ensureValidPort(v);\n }\n }\n return _port.call(this, v, build);\n };\n p.hostname = function(v, build) {\n if (this._parts.urn) return v === undefined ? \"\" : this;\n if (v !== undefined) {\n var x = {\n preventInvalidHostname: this._parts.preventInvalidHostname\n };\n var res = URI.parseHost(v, x);\n if (res !== \"/\") throw new TypeError('Hostname \"' + v + '\" contains characters other than [A-Z0-9.-]');\n v = x.hostname;\n if (this._parts.preventInvalidHostname) URI.ensureValidHostname(v, this._parts.protocol);\n }\n return _hostname.call(this, v, build);\n };\n // compound accessors\n p.origin = function(v, build) {\n if (this._parts.urn) return v === undefined ? \"\" : this;\n if (v === undefined) {\n var protocol = this.protocol();\n var authority = this.authority();\n if (!authority) return \"\";\n return (protocol ? protocol + \"://\" : \"\") + this.authority();\n } else {\n var origin = URI(v);\n this.protocol(origin.protocol()).authority(origin.authority()).build(!build);\n return this;\n }\n };\n p.host = function(v, build) {\n if (this._parts.urn) return v === undefined ? \"\" : this;\n if (v === undefined) return this._parts.hostname ? URI.buildHost(this._parts) : \"\";\n else {\n var res = URI.parseHost(v, this._parts);\n if (res !== \"/\") throw new TypeError('Hostname \"' + v + '\" contains characters other than [A-Z0-9.-]');\n this.build(!build);\n return this;\n }\n };\n p.authority = function(v, build) {\n if (this._parts.urn) return v === undefined ? \"\" : this;\n if (v === undefined) return this._parts.hostname ? URI.buildAuthority(this._parts) : \"\";\n else {\n var res = URI.parseAuthority(v, this._parts);\n if (res !== \"/\") throw new TypeError('Hostname \"' + v + '\" contains characters other than [A-Z0-9.-]');\n this.build(!build);\n return this;\n }\n };\n p.userinfo = function(v, build) {\n if (this._parts.urn) return v === undefined ? \"\" : this;\n if (v === undefined) {\n var t = URI.buildUserinfo(this._parts);\n return t ? t.substring(0, t.length - 1) : t;\n } else {\n if (v[v.length - 1] !== \"@\") v += \"@\";\n URI.parseUserinfo(v, this._parts);\n this.build(!build);\n return this;\n }\n };\n p.resource = function(v, build) {\n var parts;\n if (v === undefined) return this.path() + this.search() + this.hash();\n parts = URI.parse(v);\n this._parts.path = parts.path;\n this._parts.query = parts.query;\n this._parts.fragment = parts.fragment;\n this.build(!build);\n return this;\n };\n // fraction accessors\n p.subdomain = function(v, build) {\n if (this._parts.urn) return v === undefined ? \"\" : this;\n // convenience, return \"www\" from \"www.example.org\"\n if (v === undefined) {\n if (!this._parts.hostname || this.is(\"IP\")) return \"\";\n // grab domain and add another segment\n var end = this._parts.hostname.length - this.domain().length - 1;\n return this._parts.hostname.substring(0, end) || \"\";\n } else {\n var e = this._parts.hostname.length - this.domain().length;\n var sub = this._parts.hostname.substring(0, e);\n var replace = new RegExp(\"^\" + escapeRegEx(sub));\n if (v && v.charAt(v.length - 1) !== \".\") v += \".\";\n if (v.indexOf(\":\") !== -1) throw new TypeError(\"Domains cannot contain colons\");\n if (v) URI.ensureValidHostname(v, this._parts.protocol);\n this._parts.hostname = this._parts.hostname.replace(replace, v);\n this.build(!build);\n return this;\n }\n };\n p.domain = function(v, build) {\n if (this._parts.urn) return v === undefined ? \"\" : this;\n if (typeof v === \"boolean\") {\n build = v;\n v = undefined;\n }\n // convenience, return \"example.org\" from \"www.example.org\"\n if (v === undefined) {\n if (!this._parts.hostname || this.is(\"IP\")) return \"\";\n // if hostname consists of 1 or 2 segments, it must be the domain\n var t = this._parts.hostname.match(/\\./g);\n if (t && t.length < 2) return this._parts.hostname;\n // grab tld and add another segment\n var end = this._parts.hostname.length - this.tld(build).length - 1;\n end = this._parts.hostname.lastIndexOf(\".\", end - 1) + 1;\n return this._parts.hostname.substring(end) || \"\";\n } else {\n if (!v) throw new TypeError(\"cannot set domain empty\");\n if (v.indexOf(\":\") !== -1) throw new TypeError(\"Domains cannot contain colons\");\n URI.ensureValidHostname(v, this._parts.protocol);\n if (!this._parts.hostname || this.is(\"IP\")) this._parts.hostname = v;\n else {\n var replace = new RegExp(escapeRegEx(this.domain()) + \"$\");\n this._parts.hostname = this._parts.hostname.replace(replace, v);\n }\n this.build(!build);\n return this;\n }\n };\n p.tld = function(v, build) {\n if (this._parts.urn) return v === undefined ? \"\" : this;\n if (typeof v === \"boolean\") {\n build = v;\n v = undefined;\n }\n // return \"org\" from \"www.example.org\"\n if (v === undefined) {\n if (!this._parts.hostname || this.is(\"IP\")) return \"\";\n var pos = this._parts.hostname.lastIndexOf(\".\");\n var tld = this._parts.hostname.substring(pos + 1);\n if (build !== true && SLD && SLD.list[tld.toLowerCase()]) return SLD.get(this._parts.hostname) || tld;\n return tld;\n } else {\n var replace;\n if (!v) throw new TypeError(\"cannot set TLD empty\");\n else if (v.match(/[^a-zA-Z0-9-]/)) {\n if (SLD && SLD.is(v)) {\n replace = new RegExp(escapeRegEx(this.tld()) + \"$\");\n this._parts.hostname = this._parts.hostname.replace(replace, v);\n } else throw new TypeError('TLD \"' + v + '\" contains characters other than [A-Z0-9]');\n } else if (!this._parts.hostname || this.is(\"IP\")) throw new ReferenceError(\"cannot set TLD on non-domain host\");\n else {\n replace = new RegExp(escapeRegEx(this.tld()) + \"$\");\n this._parts.hostname = this._parts.hostname.replace(replace, v);\n }\n this.build(!build);\n return this;\n }\n };\n p.directory = function(v, build) {\n if (this._parts.urn) return v === undefined ? \"\" : this;\n if (v === undefined || v === true) {\n if (!this._parts.path && !this._parts.hostname) return \"\";\n if (this._parts.path === \"/\") return \"/\";\n var end = this._parts.path.length - this.filename().length - 1;\n var res = this._parts.path.substring(0, end) || (this._parts.hostname ? \"/\" : \"\");\n return v ? URI.decodePath(res) : res;\n } else {\n var e = this._parts.path.length - this.filename().length;\n var directory = this._parts.path.substring(0, e);\n var replace = new RegExp(\"^\" + escapeRegEx(directory));\n // fully qualifier directories begin with a slash\n if (!this.is(\"relative\")) {\n if (!v) v = \"/\";\n if (v.charAt(0) !== \"/\") v = \"/\" + v;\n }\n // directories always end with a slash\n if (v && v.charAt(v.length - 1) !== \"/\") v += \"/\";\n v = URI.recodePath(v);\n this._parts.path = this._parts.path.replace(replace, v);\n this.build(!build);\n return this;\n }\n };\n p.filename = function(v, build) {\n if (this._parts.urn) return v === undefined ? \"\" : this;\n if (typeof v !== \"string\") {\n if (!this._parts.path || this._parts.path === \"/\") return \"\";\n var pos = this._parts.path.lastIndexOf(\"/\");\n var res = this._parts.path.substring(pos + 1);\n return v ? URI.decodePathSegment(res) : res;\n } else {\n var mutatedDirectory = false;\n if (v.charAt(0) === \"/\") v = v.substring(1);\n if (v.match(/\\.?\\//)) mutatedDirectory = true;\n var replace = new RegExp(escapeRegEx(this.filename()) + \"$\");\n v = URI.recodePath(v);\n this._parts.path = this._parts.path.replace(replace, v);\n if (mutatedDirectory) this.normalizePath(build);\n else this.build(!build);\n return this;\n }\n };\n p.suffix = function(v, build) {\n if (this._parts.urn) return v === undefined ? \"\" : this;\n if (v === undefined || v === true) {\n if (!this._parts.path || this._parts.path === \"/\") return \"\";\n var filename = this.filename();\n var pos = filename.lastIndexOf(\".\");\n var s, res;\n if (pos === -1) return \"\";\n // suffix may only contain alnum characters (yup, I made this up.)\n s = filename.substring(pos + 1);\n res = /^[a-z0-9%]+$/i.test(s) ? s : \"\";\n return v ? URI.decodePathSegment(res) : res;\n } else {\n if (v.charAt(0) === \".\") v = v.substring(1);\n var suffix = this.suffix();\n var replace;\n if (!suffix) {\n if (!v) return this;\n this._parts.path += \".\" + URI.recodePath(v);\n } else if (!v) replace = new RegExp(escapeRegEx(\".\" + suffix) + \"$\");\n else replace = new RegExp(escapeRegEx(suffix) + \"$\");\n if (replace) {\n v = URI.recodePath(v);\n this._parts.path = this._parts.path.replace(replace, v);\n }\n this.build(!build);\n return this;\n }\n };\n p.segment = function(segment, v, build) {\n var separator = this._parts.urn ? \":\" : \"/\";\n var path = this.path();\n var absolute = path.substring(0, 1) === \"/\";\n var segments = path.split(separator);\n if (segment !== undefined && typeof segment !== \"number\") {\n build = v;\n v = segment;\n segment = undefined;\n }\n if (segment !== undefined && typeof segment !== \"number\") throw new Error('Bad segment \"' + segment + '\", must be 0-based integer');\n if (absolute) segments.shift();\n if (segment < 0) // allow negative indexes to address from the end\n segment = Math.max(segments.length + segment, 0);\n if (v === undefined) /*jshint laxbreak: true */ return segment === undefined ? segments : segments[segment];\n else if (segment === null || segments[segment] === undefined) {\n if (isArray(v)) {\n segments = [];\n // collapse empty elements within array\n for(var i = 0, l = v.length; i < l; i++){\n if (!v[i].length && (!segments.length || !segments[segments.length - 1].length)) continue;\n if (segments.length && !segments[segments.length - 1].length) segments.pop();\n segments.push(trimSlashes(v[i]));\n }\n } else if (v || typeof v === \"string\") {\n v = trimSlashes(v);\n if (segments[segments.length - 1] === \"\") // empty trailing elements have to be overwritten\n // to prevent results such as /foo//bar\n segments[segments.length - 1] = v;\n else segments.push(v);\n }\n } else if (v) segments[segment] = trimSlashes(v);\n else segments.splice(segment, 1);\n if (absolute) segments.unshift(\"\");\n return this.path(segments.join(separator), build);\n };\n p.segmentCoded = function(segment, v, build) {\n var segments, i, l;\n if (typeof segment !== \"number\") {\n build = v;\n v = segment;\n segment = undefined;\n }\n if (v === undefined) {\n segments = this.segment(segment, v, build);\n if (!isArray(segments)) segments = segments !== undefined ? URI.decode(segments) : undefined;\n else for(i = 0, l = segments.length; i < l; i++)segments[i] = URI.decode(segments[i]);\n return segments;\n }\n if (!isArray(v)) v = typeof v === \"string\" || v instanceof String ? URI.encode(v) : v;\n else for(i = 0, l = v.length; i < l; i++)v[i] = URI.encode(v[i]);\n return this.segment(segment, v, build);\n };\n // mutating query string\n var q = p.query;\n p.query = function(v, build) {\n if (v === true) return URI.parseQuery(this._parts.query, this._parts.escapeQuerySpace);\n else if (typeof v === \"function\") {\n var data = URI.parseQuery(this._parts.query, this._parts.escapeQuerySpace);\n var result = v.call(this, data);\n this._parts.query = URI.buildQuery(result || data, this._parts.duplicateQueryParameters, this._parts.escapeQuerySpace);\n this.build(!build);\n return this;\n } else if (v !== undefined && typeof v !== \"string\") {\n this._parts.query = URI.buildQuery(v, this._parts.duplicateQueryParameters, this._parts.escapeQuerySpace);\n this.build(!build);\n return this;\n } else return q.call(this, v, build);\n };\n p.setQuery = function(name, value, build) {\n var data = URI.parseQuery(this._parts.query, this._parts.escapeQuerySpace);\n if (typeof name === \"string\" || name instanceof String) data[name] = value !== undefined ? value : null;\n else if (typeof name === \"object\") {\n for(var key in name)if (hasOwn.call(name, key)) data[key] = name[key];\n } else throw new TypeError(\"URI.addQuery() accepts an object, string as the name parameter\");\n this._parts.query = URI.buildQuery(data, this._parts.duplicateQueryParameters, this._parts.escapeQuerySpace);\n if (typeof name !== \"string\") build = value;\n this.build(!build);\n return this;\n };\n p.addQuery = function(name, value, build) {\n var data = URI.parseQuery(this._parts.query, this._parts.escapeQuerySpace);\n URI.addQuery(data, name, value === undefined ? null : value);\n this._parts.query = URI.buildQuery(data, this._parts.duplicateQueryParameters, this._parts.escapeQuerySpace);\n if (typeof name !== \"string\") build = value;\n this.build(!build);\n return this;\n };\n p.removeQuery = function(name, value, build) {\n var data = URI.parseQuery(this._parts.query, this._parts.escapeQuerySpace);\n URI.removeQuery(data, name, value);\n this._parts.query = URI.buildQuery(data, this._parts.duplicateQueryParameters, this._parts.escapeQuerySpace);\n if (typeof name !== \"string\") build = value;\n this.build(!build);\n return this;\n };\n p.hasQuery = function(name, value, withinArray) {\n var data = URI.parseQuery(this._parts.query, this._parts.escapeQuerySpace);\n return URI.hasQuery(data, name, value, withinArray);\n };\n p.setSearch = p.setQuery;\n p.addSearch = p.addQuery;\n p.removeSearch = p.removeQuery;\n p.hasSearch = p.hasQuery;\n // sanitizing URLs\n p.normalize = function() {\n if (this._parts.urn) return this.normalizeProtocol(false).normalizePath(false).normalizeQuery(false).normalizeFragment(false).build();\n return this.normalizeProtocol(false).normalizeHostname(false).normalizePort(false).normalizePath(false).normalizeQuery(false).normalizeFragment(false).build();\n };\n p.normalizeProtocol = function(build) {\n if (typeof this._parts.protocol === \"string\") {\n this._parts.protocol = this._parts.protocol.toLowerCase();\n this.build(!build);\n }\n return this;\n };\n p.normalizeHostname = function(build) {\n if (this._parts.hostname) {\n if (this.is(\"IDN\") && punycode) this._parts.hostname = punycode.toASCII(this._parts.hostname);\n else if (this.is(\"IPv6\") && IPv6) this._parts.hostname = IPv6.best(this._parts.hostname);\n this._parts.hostname = this._parts.hostname.toLowerCase();\n this.build(!build);\n }\n return this;\n };\n p.normalizePort = function(build) {\n // remove port of it's the protocol's default\n if (typeof this._parts.protocol === \"string\" && this._parts.port === URI.defaultPorts[this._parts.protocol]) {\n this._parts.port = null;\n this.build(!build);\n }\n return this;\n };\n p.normalizePath = function(build) {\n var _path = this._parts.path;\n if (!_path) return this;\n if (this._parts.urn) {\n this._parts.path = URI.recodeUrnPath(this._parts.path);\n this.build(!build);\n return this;\n }\n if (this._parts.path === \"/\") return this;\n _path = URI.recodePath(_path);\n var _was_relative;\n var _leadingParents = \"\";\n var _parent, _pos;\n // handle relative paths\n if (_path.charAt(0) !== \"/\") {\n _was_relative = true;\n _path = \"/\" + _path;\n }\n // handle relative files (as opposed to directories)\n if (_path.slice(-3) === \"/..\" || _path.slice(-2) === \"/.\") _path += \"/\";\n // resolve simples\n _path = _path.replace(/(\\/(\\.\\/)+)|(\\/\\.$)/g, \"/\").replace(/\\/{2,}/g, \"/\");\n // remember leading parents\n if (_was_relative) {\n _leadingParents = _path.substring(1).match(/^(\\.\\.\\/)+/) || \"\";\n if (_leadingParents) _leadingParents = _leadingParents[0];\n }\n // resolve parents\n while(true){\n _parent = _path.search(/\\/\\.\\.(\\/|$)/);\n if (_parent === -1) break;\n else if (_parent === 0) {\n // top level cannot be relative, skip it\n _path = _path.substring(3);\n continue;\n }\n _pos = _path.substring(0, _parent).lastIndexOf(\"/\");\n if (_pos === -1) _pos = _parent;\n _path = _path.substring(0, _pos) + _path.substring(_parent + 3);\n }\n // revert to relative\n if (_was_relative && this.is(\"relative\")) _path = _leadingParents + _path.substring(1);\n this._parts.path = _path;\n this.build(!build);\n return this;\n };\n p.normalizePathname = p.normalizePath;\n p.normalizeQuery = function(build) {\n if (typeof this._parts.query === \"string\") {\n if (!this._parts.query.length) this._parts.query = null;\n else this.query(URI.parseQuery(this._parts.query, this._parts.escapeQuerySpace));\n this.build(!build);\n }\n return this;\n };\n p.normalizeFragment = function(build) {\n if (!this._parts.fragment) {\n this._parts.fragment = null;\n this.build(!build);\n }\n return this;\n };\n p.normalizeSearch = p.normalizeQuery;\n p.normalizeHash = p.normalizeFragment;\n p.iso8859 = function() {\n // expect unicode input, iso8859 output\n var e = URI.encode;\n var d = URI.decode;\n URI.encode = escape;\n URI.decode = decodeURIComponent;\n try {\n this.normalize();\n } finally{\n URI.encode = e;\n URI.decode = d;\n }\n return this;\n };\n p.unicode = function() {\n // expect iso8859 input, unicode output\n var e = URI.encode;\n var d = URI.decode;\n URI.encode = strictEncodeURIComponent;\n URI.decode = unescape;\n try {\n this.normalize();\n } finally{\n URI.encode = e;\n URI.decode = d;\n }\n return this;\n };\n p.readable = function() {\n var uri = this.clone();\n // removing username, password, because they shouldn't be displayed according to RFC 3986\n uri.username(\"\").password(\"\").normalize();\n var t = \"\";\n if (uri._parts.protocol) t += uri._parts.protocol + \"://\";\n if (uri._parts.hostname) {\n if (uri.is(\"punycode\") && punycode) {\n t += punycode.toUnicode(uri._parts.hostname);\n if (uri._parts.port) t += \":\" + uri._parts.port;\n } else t += uri.host();\n }\n if (uri._parts.hostname && uri._parts.path && uri._parts.path.charAt(0) !== \"/\") t += \"/\";\n t += uri.path(true);\n if (uri._parts.query) {\n var q = \"\";\n for(var i = 0, qp = uri._parts.query.split(\"&\"), l = qp.length; i < l; i++){\n var kv = (qp[i] || \"\").split(\"=\");\n q += \"&\" + URI.decodeQuery(kv[0], this._parts.escapeQuerySpace).replace(/&/g, \"%26\");\n if (kv[1] !== undefined) q += \"=\" + URI.decodeQuery(kv[1], this._parts.escapeQuerySpace).replace(/&/g, \"%26\");\n }\n t += \"?\" + q.substring(1);\n }\n t += URI.decodeQuery(uri.hash(), true);\n return t;\n };\n // resolving relative and absolute URLs\n p.absoluteTo = function(base) {\n var resolved = this.clone();\n var properties = [\n \"protocol\",\n \"username\",\n \"password\",\n \"hostname\",\n \"port\"\n ];\n var basedir, i, p;\n if (this._parts.urn) throw new Error(\"URNs do not have any generally defined hierarchical components\");\n if (!(base instanceof URI)) base = new URI(base);\n if (resolved._parts.protocol) // Directly returns even if this._parts.hostname is empty.\n return resolved;\n else resolved._parts.protocol = base._parts.protocol;\n if (this._parts.hostname) return resolved;\n for(i = 0; p = properties[i]; i++)resolved._parts[p] = base._parts[p];\n if (!resolved._parts.path) {\n resolved._parts.path = base._parts.path;\n if (!resolved._parts.query) resolved._parts.query = base._parts.query;\n } else {\n if (resolved._parts.path.substring(-2) === \"..\") resolved._parts.path += \"/\";\n if (resolved.path().charAt(0) !== \"/\") {\n basedir = base.directory();\n basedir = basedir ? basedir : base.path().indexOf(\"/\") === 0 ? \"/\" : \"\";\n resolved._parts.path = (basedir ? basedir + \"/\" : \"\") + resolved._parts.path;\n resolved.normalizePath();\n }\n }\n resolved.build();\n return resolved;\n };\n p.relativeTo = function(base) {\n var relative = this.clone().normalize();\n var relativeParts, baseParts, common, relativePath, basePath;\n if (relative._parts.urn) throw new Error(\"URNs do not have any generally defined hierarchical components\");\n base = new URI(base).normalize();\n relativeParts = relative._parts;\n baseParts = base._parts;\n relativePath = relative.path();\n basePath = base.path();\n if (relativePath.charAt(0) !== \"/\") throw new Error(\"URI is already relative\");\n if (basePath.charAt(0) !== \"/\") throw new Error(\"Cannot calculate a URI relative to another relative URI\");\n if (relativeParts.protocol === baseParts.protocol) relativeParts.protocol = null;\n if (relativeParts.username !== baseParts.username || relativeParts.password !== baseParts.password) return relative.build();\n if (relativeParts.protocol !== null || relativeParts.username !== null || relativeParts.password !== null) return relative.build();\n if (relativeParts.hostname === baseParts.hostname && relativeParts.port === baseParts.port) {\n relativeParts.hostname = null;\n relativeParts.port = null;\n } else return relative.build();\n if (relativePath === basePath) {\n relativeParts.path = \"\";\n return relative.build();\n }\n // determine common sub path\n common = URI.commonPath(relativePath, basePath);\n // If the paths have nothing in common, return a relative URL with the absolute path.\n if (!common) return relative.build();\n var parents = baseParts.path.substring(common.length).replace(/[^\\/]*$/, \"\").replace(/.*?\\//g, \"../\");\n relativeParts.path = parents + relativeParts.path.substring(common.length) || \"./\";\n return relative.build();\n };\n // comparing URIs\n p.equals = function(uri) {\n var one = this.clone();\n var two = new URI(uri);\n var one_map = {};\n var two_map = {};\n var checked = {};\n var one_query, two_query, key;\n one.normalize();\n two.normalize();\n // exact match\n if (one.toString() === two.toString()) return true;\n // extract query string\n one_query = one.query();\n two_query = two.query();\n one.query(\"\");\n two.query(\"\");\n // definitely not equal if not even non-query parts match\n if (one.toString() !== two.toString()) return false;\n // query parameters have the same length, even if they're permuted\n if (one_query.length !== two_query.length) return false;\n one_map = URI.parseQuery(one_query, this._parts.escapeQuerySpace);\n two_map = URI.parseQuery(two_query, this._parts.escapeQuerySpace);\n for(key in one_map)if (hasOwn.call(one_map, key)) {\n if (!isArray(one_map[key])) {\n if (one_map[key] !== two_map[key]) return false;\n } else if (!arraysEqual(one_map[key], two_map[key])) return false;\n checked[key] = true;\n }\n for(key in two_map)if (hasOwn.call(two_map, key)) {\n if (!checked[key]) // two contains a parameter not present in one\n return false;\n }\n return true;\n };\n // state\n p.preventInvalidHostname = function(v) {\n this._parts.preventInvalidHostname = !!v;\n return this;\n };\n p.duplicateQueryParameters = function(v) {\n this._parts.duplicateQueryParameters = !!v;\n return this;\n };\n p.escapeQuerySpace = function(v) {\n this._parts.escapeQuerySpace = !!v;\n return this;\n };\n return URI;\n});\n\n\n/**\n * @private\n */ function $120bf72c64f9e0f4$var$appendForwardSlash(url) {\n if (url.length === 0 || url[url.length - 1] !== \"/\") url = `${url}/`;\n return url;\n}\nvar $120bf72c64f9e0f4$export$2e2bcd8739ae039 = $120bf72c64f9e0f4$var$appendForwardSlash;\n\n\n\nvar $3pzcG = parcelRequire(\"3pzcG\");\n\nvar $8w8ZH = parcelRequire(\"8w8ZH\");\n/**\n * Clones an object, returning a new object containing the same properties.\n *\n * @function\n *\n * @param {object} object The object to clone.\n * @param {boolean} [deep=false] If true, all properties will be deep cloned recursively.\n * @returns {object} The cloned object.\n */ function $3f52ff37d0636f55$var$clone(object, deep) {\n if (object === null || typeof object !== \"object\") return object;\n deep = (0, $8w8ZH.default)(deep, false);\n const result = new object.constructor();\n for(const propertyName in object)if (object.hasOwnProperty(propertyName)) {\n let value = object[propertyName];\n if (deep) value = $3f52ff37d0636f55$var$clone(value, deep);\n result[propertyName] = value;\n }\n return result;\n}\nvar $3f52ff37d0636f55$export$2e2bcd8739ae039 = $3f52ff37d0636f55$var$clone;\n\n\n\nvar $8w8ZH = parcelRequire(\"8w8ZH\");\n\nvar $jQJji = parcelRequire(\"jQJji\");\n/**\n * Merges two objects, copying their properties onto a new combined object. When two objects have the same\n * property, the value of the property on the first object is used. If either object is undefined,\n * it will be treated as an empty object.\n *\n * @example\n * const object1 = {\n * propOne : 1,\n * propTwo : {\n * value1 : 10\n * }\n * }\n * const object2 = {\n * propTwo : 2\n * }\n * const final = Cesium.combine(object1, object2);\n *\n * // final === {\n * // propOne : 1,\n * // propTwo : {\n * // value1 : 10\n * // }\n * // }\n *\n * @param {object} [object1] The first object to merge.\n * @param {object} [object2] The second object to merge.\n * @param {boolean} [deep=false] Perform a recursive merge.\n * @returns {object} The combined object containing all properties from both objects.\n *\n * @function\n */ function $8e522a73a8dfbfe2$var$combine(object1, object2, deep) {\n deep = (0, $8w8ZH.default)(deep, false);\n const result = {};\n const object1Defined = (0, $jQJji.default)(object1);\n const object2Defined = (0, $jQJji.default)(object2);\n let property;\n let object1Value;\n let object2Value;\n if (object1Defined) {\n for(property in object1)if (object1.hasOwnProperty(property)) {\n object1Value = object1[property];\n if (object2Defined && deep && typeof object1Value === \"object\" && object2.hasOwnProperty(property)) {\n object2Value = object2[property];\n if (typeof object2Value === \"object\") result[property] = $8e522a73a8dfbfe2$var$combine(object1Value, object2Value, deep);\n else result[property] = object1Value;\n } else result[property] = object1Value;\n }\n }\n if (object2Defined) {\n for(property in object2)if (object2.hasOwnProperty(property) && !result.hasOwnProperty(property)) {\n object2Value = object2[property];\n result[property] = object2Value;\n }\n }\n return result;\n}\nvar $8e522a73a8dfbfe2$export$2e2bcd8739ae039 = $8e522a73a8dfbfe2$var$combine;\n\n\n\nvar $8w8ZH = parcelRequire(\"8w8ZH\");\n/**\n * A function used to resolve a promise upon completion .\n * @callback defer.resolve\n *\n * @param {*} value The resulting value.\n */ /**\n * A function used to reject a promise upon failure.\n * @callback defer.reject\n *\n * @param {*} error The error.\n */ /**\n * An object which contains a promise object, and functions to resolve or reject the promise.\n *\n * @typedef {object} defer.deferred\n * @property {defer.resolve} resolve Resolves the promise when called.\n * @property {defer.reject} reject Rejects the promise when called.\n * @property {Promise} promise Promise object.\n */ /**\n * Creates a deferred object, containing a promise object, and functions to resolve or reject the promise.\n * @returns {defer.deferred}\n * @private\n */ function $6e11a2ab1ac0872e$var$defer() {\n let resolve;\n let reject;\n const promise = new Promise(function(res, rej) {\n resolve = res;\n reject = rej;\n });\n return {\n resolve: resolve,\n reject: reject,\n promise: promise\n };\n}\nvar $6e11a2ab1ac0872e$export$2e2bcd8739ae039 = $6e11a2ab1ac0872e$var$defer;\n\n\n\nvar $jQJji = parcelRequire(\"jQJji\");\n\nvar $1vHsR = parcelRequire(\"1vHsR\");\n\n\nvar $8w8ZH = parcelRequire(\"8w8ZH\");\n\nvar $jQJji = parcelRequire(\"jQJji\");\n\nvar $1vHsR = parcelRequire(\"1vHsR\");\n/**\n * Given a relative Uri and a base Uri, returns the absolute Uri of the relative Uri.\n * @function\n *\n * @param {string} relative The relative Uri.\n * @param {string} [base] The base Uri.\n * @returns {string} The absolute Uri of the given relative Uri.\n *\n * @example\n * //absolute Uri will be \"https://test.com/awesome.png\";\n * const absoluteUri = Cesium.getAbsoluteUri('awesome.png', 'https://test.com');\n */ function $5d7f3681ccbe43e2$var$getAbsoluteUri(relative, base) {\n let documentObject;\n if (typeof document !== \"undefined\") documentObject = document;\n return $5d7f3681ccbe43e2$var$getAbsoluteUri._implementation(relative, base, documentObject);\n}\n$5d7f3681ccbe43e2$var$getAbsoluteUri._implementation = function(relative, base, documentObject) {\n //>>includeStart('debug', pragmas.debug);\n if (!(0, $jQJji.default)(relative)) throw new (0, $1vHsR.default)(\"relative uri is required.\");\n //>>includeEnd('debug');\n if (!(0, $jQJji.default)(base)) {\n if (typeof documentObject === \"undefined\") return relative;\n base = (0, $8w8ZH.default)(documentObject.baseURI, documentObject.location.href);\n }\n const relativeUri = new (0, (/*@__PURE__*/$parcel$interopDefault($f3b7c43a7f0c8e85$exports)))(relative);\n if (relativeUri.scheme() !== \"\") return relativeUri.toString();\n return relativeUri.absoluteTo(base).toString();\n};\nvar $5d7f3681ccbe43e2$export$2e2bcd8739ae039 = $5d7f3681ccbe43e2$var$getAbsoluteUri;\n\n\n\n\nvar $jQJji = parcelRequire(\"jQJji\");\n\nvar $1vHsR = parcelRequire(\"1vHsR\");\n/**\n * Given a URI, returns the base path of the URI.\n * @function\n *\n * @param {string} uri The Uri.\n * @param {boolean} [includeQuery = false] Whether or not to include the query string and fragment form the uri\n * @returns {string} The base path of the Uri.\n *\n * @example\n * // basePath will be \"/Gallery/\";\n * const basePath = Cesium.getBaseUri('/Gallery/simple.czml?value=true&example=false');\n *\n * // basePath will be \"/Gallery/?value=true&example=false\";\n * const basePath = Cesium.getBaseUri('/Gallery/simple.czml?value=true&example=false', true);\n */ function $d4cdc3514a25210c$var$getBaseUri(uri, includeQuery) {\n //>>includeStart('debug', pragmas.debug);\n if (!(0, $jQJji.default)(uri)) throw new (0, $1vHsR.default)(\"uri is required.\");\n //>>includeEnd('debug');\n let basePath = \"\";\n const i = uri.lastIndexOf(\"/\");\n if (i !== -1) basePath = uri.substring(0, i + 1);\n if (!includeQuery) return basePath;\n uri = new (0, (/*@__PURE__*/$parcel$interopDefault($f3b7c43a7f0c8e85$exports)))(uri);\n if (uri.query().length !== 0) basePath += `?${uri.query()}`;\n if (uri.fragment().length !== 0) basePath += `#${uri.fragment()}`;\n return basePath;\n}\nvar $d4cdc3514a25210c$export$2e2bcd8739ae039 = $d4cdc3514a25210c$var$getBaseUri;\n\n\n\n\nvar $jQJji = parcelRequire(\"jQJji\");\n\nvar $1vHsR = parcelRequire(\"1vHsR\");\n/**\n * Given a URI, returns the extension of the URI.\n * @function getExtensionFromUri\n *\n * @param {string} uri The Uri.\n * @returns {string} The extension of the Uri.\n *\n * @example\n * //extension will be \"czml\";\n * const extension = Cesium.getExtensionFromUri('/Gallery/simple.czml?value=true&example=false');\n */ function $dce14f3284a3bc25$var$getExtensionFromUri(uri) {\n //>>includeStart('debug', pragmas.debug);\n if (!(0, $jQJji.default)(uri)) throw new (0, $1vHsR.default)(\"uri is required.\");\n //>>includeEnd('debug');\n const uriObject = new (0, (/*@__PURE__*/$parcel$interopDefault($f3b7c43a7f0c8e85$exports)))(uri);\n uriObject.normalize();\n let path = uriObject.path();\n let index = path.lastIndexOf(\"/\");\n if (index !== -1) path = path.substr(index + 1);\n index = path.lastIndexOf(\".\");\n if (index === -1) path = \"\";\n else path = path.substr(index + 1);\n return path;\n}\nvar $dce14f3284a3bc25$export$2e2bcd8739ae039 = $dce14f3284a3bc25$var$getExtensionFromUri;\n\n\n\nvar $jQJji = parcelRequire(\"jQJji\");\nconst $5db98adec2cfcc7b$var$context2DsByWidthAndHeight = {};\n/**\n * Extract a pixel array from a loaded image. Draws the image\n * into a canvas so it can read the pixels back.\n *\n * @function getImagePixels\n *\n * @param {HTMLImageElement|ImageBitmap} image The image to extract pixels from.\n * @param {number} width The width of the image. If not defined, then image.width is assigned.\n * @param {number} height The height of the image. If not defined, then image.height is assigned.\n * @returns {ImageData} The pixels of the image.\n */ function $5db98adec2cfcc7b$var$getImagePixels(image, width, height) {\n if (!(0, $jQJji.default)(width)) width = image.width;\n if (!(0, $jQJji.default)(height)) height = image.height;\n let context2DsByHeight = $5db98adec2cfcc7b$var$context2DsByWidthAndHeight[width];\n if (!(0, $jQJji.default)(context2DsByHeight)) {\n context2DsByHeight = {};\n $5db98adec2cfcc7b$var$context2DsByWidthAndHeight[width] = context2DsByHeight;\n }\n let context2d = context2DsByHeight[height];\n if (!(0, $jQJji.default)(context2d)) {\n const canvas = document.createElement(\"canvas\");\n canvas.width = width;\n canvas.height = height;\n // Since we re-use contexts, use the willReadFrequently option – See https://html.spec.whatwg.org/multipage/canvas.html#concept-canvas-will-read-frequently\n context2d = canvas.getContext(\"2d\", {\n willReadFrequently: true\n });\n context2d.globalCompositeOperation = \"copy\";\n context2DsByHeight[height] = context2d;\n }\n context2d.drawImage(image, 0, 0, width, height);\n return context2d.getImageData(0, 0, width, height).data;\n}\nvar $5db98adec2cfcc7b$export$2e2bcd8739ae039 = $5db98adec2cfcc7b$var$getImagePixels;\n\n\n\nvar $3pzcG = parcelRequire(\"3pzcG\");\nconst $9f0272ac2370f543$var$blobUriRegex = /^blob:/i;\n/**\n * Determines if the specified uri is a blob uri.\n *\n * @function isBlobUri\n *\n * @param {string} uri The uri to test.\n * @returns {boolean} true when the uri is a blob uri; otherwise, false.\n *\n * @private\n */ function $9f0272ac2370f543$var$isBlobUri(uri) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.string(\"uri\", uri);\n //>>includeEnd('debug');\n return $9f0272ac2370f543$var$blobUriRegex.test(uri);\n}\nvar $9f0272ac2370f543$export$2e2bcd8739ae039 = $9f0272ac2370f543$var$isBlobUri;\n\n\n\nvar $jQJji = parcelRequire(\"jQJji\");\nlet $6fb706f4a1c1ff12$var$a;\n/**\n * Given a URL, determine whether that URL is considered cross-origin to the current page.\n *\n * @private\n */ function $6fb706f4a1c1ff12$var$isCrossOriginUrl(url) {\n if (!(0, $jQJji.default)($6fb706f4a1c1ff12$var$a)) $6fb706f4a1c1ff12$var$a = document.createElement(\"a\");\n // copy window location into the anchor to get consistent results\n // when the port is default for the protocol (e.g. 80 for HTTP)\n $6fb706f4a1c1ff12$var$a.href = window.location.href;\n // host includes both hostname and port if the port is not standard\n const host = $6fb706f4a1c1ff12$var$a.host;\n const protocol = $6fb706f4a1c1ff12$var$a.protocol;\n $6fb706f4a1c1ff12$var$a.href = url;\n // IE only absolutizes href on get, not set\n // eslint-disable-next-line no-self-assign\n $6fb706f4a1c1ff12$var$a.href = $6fb706f4a1c1ff12$var$a.href;\n return protocol !== $6fb706f4a1c1ff12$var$a.protocol || host !== $6fb706f4a1c1ff12$var$a.host;\n}\nvar $6fb706f4a1c1ff12$export$2e2bcd8739ae039 = $6fb706f4a1c1ff12$var$isCrossOriginUrl;\n\n\n\nvar $3pzcG = parcelRequire(\"3pzcG\");\nconst $9cb2c183cad552bd$var$dataUriRegex = /^data:/i;\n/**\n * Determines if the specified uri is a data uri.\n *\n * @function isDataUri\n *\n * @param {string} uri The uri to test.\n * @returns {boolean} true when the uri is a data uri; otherwise, false.\n *\n * @private\n */ function $9cb2c183cad552bd$var$isDataUri(uri) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.string(\"uri\", uri);\n //>>includeEnd('debug');\n return $9cb2c183cad552bd$var$dataUriRegex.test(uri);\n}\nvar $9cb2c183cad552bd$export$2e2bcd8739ae039 = $9cb2c183cad552bd$var$isDataUri;\n\n\n/**\n * @private\n */ function $e3fa9c82e19e3667$var$loadAndExecuteScript(url) {\n const script = document.createElement(\"script\");\n script.async = true;\n script.src = url;\n return new Promise((resolve, reject)=>{\n if (window.crossOriginIsolated) script.setAttribute(\"crossorigin\", \"anonymous\");\n const head = document.getElementsByTagName(\"head\")[0];\n script.onload = function() {\n script.onload = undefined;\n head.removeChild(script);\n resolve();\n };\n script.onerror = function(e) {\n reject(e);\n };\n head.appendChild(script);\n });\n}\nvar $e3fa9c82e19e3667$export$2e2bcd8739ae039 = $e3fa9c82e19e3667$var$loadAndExecuteScript;\n\n\n\nvar $AXvpI = parcelRequire(\"AXvpI\");\n\nvar $jQJji = parcelRequire(\"jQJji\");\n\nvar $1vHsR = parcelRequire(\"1vHsR\");\n/**\n * Converts an object representing a set of name/value pairs into a query string,\n * with names and values encoded properly for use in a URL. Values that are arrays\n * will produce multiple values with the same name.\n * @function objectToQuery\n *\n * @param {object} obj The object containing data to encode.\n * @returns {string} An encoded query string.\n *\n *\n * @example\n * const str = Cesium.objectToQuery({\n * key1 : 'some value',\n * key2 : 'a/b',\n * key3 : ['x', 'y']\n * });\n *\n * @see queryToObject\n * // str will be:\n * // 'key1=some%20value&key2=a%2Fb&key3=x&key3=y'\n */ function $cdf3d7de0c82329e$var$objectToQuery(obj) {\n //>>includeStart('debug', pragmas.debug);\n if (!(0, $jQJji.default)(obj)) throw new (0, $1vHsR.default)(\"obj is required.\");\n //>>includeEnd('debug');\n let result = \"\";\n for(const propName in obj)if (obj.hasOwnProperty(propName)) {\n const value = obj[propName];\n const part = `${encodeURIComponent(propName)}=`;\n if (Array.isArray(value)) for(let i = 0, len = value.length; i < len; ++i)result += `${part + encodeURIComponent(value[i])}&`;\n else result += `${part + encodeURIComponent(value)}&`;\n }\n // trim last &\n result = result.slice(0, -1);\n // This function used to replace %20 with + which is more compact and readable.\n // However, some servers didn't properly handle + as a space.\n // https://github.com/CesiumGS/cesium/issues/2192\n return result;\n}\nvar $cdf3d7de0c82329e$export$2e2bcd8739ae039 = $cdf3d7de0c82329e$var$objectToQuery;\n\n\n\nvar $jQJji = parcelRequire(\"jQJji\");\n\nvar $1vHsR = parcelRequire(\"1vHsR\");\n/**\n * Parses a query string into an object, where the keys and values of the object are the\n * name/value pairs from the query string, decoded. If a name appears multiple times,\n * the value in the object will be an array of values.\n * @function queryToObject\n *\n * @param {string} queryString The query string.\n * @returns {object} An object containing the parameters parsed from the query string.\n *\n *\n * @example\n * const obj = Cesium.queryToObject('key1=some%20value&key2=a%2Fb&key3=x&key3=y');\n * // obj will be:\n * // {\n * // key1 : 'some value',\n * // key2 : 'a/b',\n * // key3 : ['x', 'y']\n * // }\n *\n * @see objectToQuery\n */ function $cec685f2ea286a8a$var$queryToObject(queryString) {\n //>>includeStart('debug', pragmas.debug);\n if (!(0, $jQJji.default)(queryString)) throw new (0, $1vHsR.default)(\"queryString is required.\");\n //>>includeEnd('debug');\n const result = {};\n if (queryString === \"\") return result;\n const parts = queryString.replace(/\\+/g, \"%20\").split(/[&;]/);\n for(let i = 0, len = parts.length; i < len; ++i){\n const subparts = parts[i].split(\"=\");\n const name = decodeURIComponent(subparts[0]);\n let value = subparts[1];\n if ((0, $jQJji.default)(value)) value = decodeURIComponent(value);\n else value = \"\";\n const resultValue = result[name];\n if (typeof resultValue === \"string\") // expand the single value to an array\n result[name] = [\n resultValue,\n value\n ];\n else if (Array.isArray(resultValue)) resultValue.push(value);\n else result[name] = value;\n }\n return result;\n}\nvar $cec685f2ea286a8a$export$2e2bcd8739ae039 = $cec685f2ea286a8a$var$queryToObject;\n\n\n\nvar $8w8ZH = parcelRequire(\"8w8ZH\");\n\nvar $jQJji = parcelRequire(\"jQJji\");\n/**\n * State of the request.\n *\n * @enum {number}\n */ const $3f5372c4ce85d94e$var$RequestState = {\n /**\n * Initial unissued state.\n *\n * @type {number}\n * @constant\n */ UNISSUED: 0,\n /**\n * Issued but not yet active. Will become active when open slots are available.\n *\n * @type {number}\n * @constant\n */ ISSUED: 1,\n /**\n * Actual http request has been sent.\n *\n * @type {number}\n * @constant\n */ ACTIVE: 2,\n /**\n * Request completed successfully.\n *\n * @type {number}\n * @constant\n */ RECEIVED: 3,\n /**\n * Request was cancelled, either explicitly or automatically because of low priority.\n *\n * @type {number}\n * @constant\n */ CANCELLED: 4,\n /**\n * Request failed.\n *\n * @type {number}\n * @constant\n */ FAILED: 5\n};\nvar $3f5372c4ce85d94e$export$2e2bcd8739ae039 = Object.freeze($3f5372c4ce85d94e$var$RequestState);\n\n\n/**\n * An enum identifying the type of request. Used for finer grained logging and priority sorting.\n *\n * @enum {number}\n */ const $a60081784b299462$var$RequestType = {\n /**\n * Terrain request.\n *\n * @type {number}\n * @constant\n */ TERRAIN: 0,\n /**\n * Imagery request.\n *\n * @type {number}\n * @constant\n */ IMAGERY: 1,\n /**\n * 3D Tiles request.\n *\n * @type {number}\n * @constant\n */ TILES3D: 2,\n /**\n * Other request.\n *\n * @type {number}\n * @constant\n */ OTHER: 3\n};\nvar $a60081784b299462$export$2e2bcd8739ae039 = Object.freeze($a60081784b299462$var$RequestType);\n\n\n/**\n * Stores information for making a request. In general this does not need to be constructed directly.\n *\n * @alias Request\n * @constructor\n\n * @param {object} [options] An object with the following properties:\n * @param {string} [options.url] The url to request.\n * @param {Request.RequestCallback} [options.requestFunction] The function that makes the actual data request.\n * @param {Request.CancelCallback} [options.cancelFunction] The function that is called when the request is cancelled.\n * @param {Request.PriorityCallback} [options.priorityFunction] The function that is called to update the request's priority, which occurs once per frame.\n * @param {number} [options.priority=0.0] The initial priority of the request.\n * @param {boolean} [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.\n * @param {boolean} [options.throttleByServer=false] Whether to throttle the request by server.\n * @param {RequestType} [options.type=RequestType.OTHER] The type of request.\n * @param {string} [options.serverKey] A key used to identify the server that a request is going to.\n */ function $b1445a5361079efc$var$Request(options) {\n options = (0, $8w8ZH.default)(options, (0, $8w8ZH.default).EMPTY_OBJECT);\n const throttleByServer = (0, $8w8ZH.default)(options.throttleByServer, false);\n const throttle = (0, $8w8ZH.default)(options.throttle, false);\n /**\n * The URL to request.\n *\n * @type {string}\n */ this.url = options.url;\n /**\n * The function that makes the actual data request.\n *\n * @type {Request.RequestCallback}\n */ this.requestFunction = options.requestFunction;\n /**\n * The function that is called when the request is cancelled.\n *\n * @type {Request.CancelCallback}\n */ this.cancelFunction = options.cancelFunction;\n /**\n * The function that is called to update the request's priority, which occurs once per frame.\n *\n * @type {Request.PriorityCallback}\n */ this.priorityFunction = options.priorityFunction;\n /**\n * Priority is a unit-less value where lower values represent higher priority.\n * For world-based objects, this is usually the distance from the camera.\n * A request that does not have a priority function defaults to a priority of 0.\n *\n * If priorityFunction is defined, this value is updated every frame with the result of that call.\n *\n * @type {number}\n * @default 0.0\n */ this.priority = (0, $8w8ZH.default)(options.priority, 0.0);\n /**\n * Whether to throttle and prioritize the request. If false, the request will be sent immediately. If true, the\n * request will be throttled and sent based on priority.\n *\n * @type {boolean}\n * @readonly\n *\n * @default false\n */ this.throttle = throttle;\n /**\n * Whether to throttle the request by server. Browsers typically support about 6-8 parallel connections\n * for HTTP/1 servers, and an unlimited amount of connections for HTTP/2 servers. Setting this value\n * to true
is preferable for requests going through HTTP/1 servers.\n *\n * @type {boolean}\n * @readonly\n *\n * @default false\n */ this.throttleByServer = throttleByServer;\n /**\n * Type of request.\n *\n * @type {RequestType}\n * @readonly\n *\n * @default RequestType.OTHER\n */ this.type = (0, $8w8ZH.default)(options.type, (0, $a60081784b299462$export$2e2bcd8739ae039).OTHER);\n /**\n * A key used to identify the server that a request is going to. It is derived from the url's authority and scheme.\n *\n * @type {string}\n *\n * @private\n */ this.serverKey = options.serverKey;\n /**\n * The current state of the request.\n *\n * @type {RequestState}\n * @readonly\n */ this.state = (0, $3f5372c4ce85d94e$export$2e2bcd8739ae039).UNISSUED;\n /**\n * The requests's deferred promise.\n *\n * @type {object}\n *\n * @private\n */ this.deferred = undefined;\n /**\n * Whether the request was explicitly cancelled.\n *\n * @type {boolean}\n *\n * @private\n */ this.cancelled = false;\n}\n/**\n * Mark the request as cancelled.\n *\n * @private\n */ $b1445a5361079efc$var$Request.prototype.cancel = function() {\n this.cancelled = true;\n};\n/**\n * Duplicates a Request instance.\n *\n * @param {Request} [result] The object onto which to store the result.\n *\n * @returns {Request} The modified result parameter or a new Resource instance if one was not provided.\n */ $b1445a5361079efc$var$Request.prototype.clone = function(result) {\n if (!(0, $jQJji.default)(result)) return new $b1445a5361079efc$var$Request(this);\n result.url = this.url;\n result.requestFunction = this.requestFunction;\n result.cancelFunction = this.cancelFunction;\n result.priorityFunction = this.priorityFunction;\n result.priority = this.priority;\n result.throttle = this.throttle;\n result.throttleByServer = this.throttleByServer;\n result.type = this.type;\n result.serverKey = this.serverKey;\n // These get defaulted because the cloned request hasn't been issued\n result.state = (0, $3f5372c4ce85d94e$export$2e2bcd8739ae039).UNISSUED;\n result.deferred = undefined;\n result.cancelled = false;\n return result;\n};\nvar /**\n * The function that makes the actual data request.\n * @callback Request.RequestCallback\n * @returns {Promisethis
pointer\n * in which the function will execute.\n *\n * @param {Listener} listener The function to be executed when the event is raised.\n * @param {object} [scope] An optional object scope to serve as the this
\n * pointer in which the listener function will execute.\n * @returns {Event.RemoveCallback} A function that will remove this event listener when invoked.\n *\n * @see Event#raiseEvent\n * @see Event#removeEventListener\n */ $280a3f96dcc2704b$var$Event.prototype.addEventListener = function(listener, scope) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.func(\"listener\", listener);\n //>>includeEnd('debug');\n this._listeners.push(listener);\n this._scopes.push(scope);\n const event = this;\n return function() {\n event.removeEventListener(listener, scope);\n };\n};\n/**\n * Unregisters a previously registered callback.\n *\n * @param {Listener} listener The function to be unregistered.\n * @param {object} [scope] The scope that was originally passed to addEventListener.\n * @returns {boolean} true
if the listener was removed; false
if the listener and scope are not registered with the event.\n *\n * @see Event#addEventListener\n * @see Event#raiseEvent\n */ $280a3f96dcc2704b$var$Event.prototype.removeEventListener = function(listener, scope) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.func(\"listener\", listener);\n //>>includeEnd('debug');\n const listeners = this._listeners;\n const scopes = this._scopes;\n let index = -1;\n for(let i = 0; i < listeners.length; i++)if (listeners[i] === listener && scopes[i] === scope) {\n index = i;\n break;\n }\n if (index !== -1) {\n if (this._insideRaiseEvent) {\n //In order to allow removing an event subscription from within\n //a callback, we don't actually remove the items here. Instead\n //remember the index they are at and undefined their value.\n this._toRemove.push(index);\n listeners[index] = undefined;\n scopes[index] = undefined;\n } else {\n listeners.splice(index, 1);\n scopes.splice(index, 1);\n }\n return true;\n }\n return false;\n};\nfunction $280a3f96dcc2704b$var$compareNumber(a, b) {\n return b - a;\n}\n/**\n * Raises the event by calling each registered listener with all supplied arguments.\n *\n * @param {...ParametersmaximumRequestsPerServer
.\n * Useful when streaming data from a known HTTP/2 or HTTP/3 server.\n * @type {object}\n *\n * @example\n * RequestScheduler.requestsByServer[\"myserver.com:443\"] = 18;\n *\n * @example\n * RequestScheduler.requestsByServer = {\n * \"api.cesium.com:443\": 18,\n * \"assets.cesium.com:443\": 18,\n * };\n */ $22996820477a6820$var$RequestScheduler.requestsByServer = {};\n/**\n * Specifies if the request scheduler should throttle incoming requests, or let the browser queue requests under its control.\n * @type {boolean}\n * @default true\n */ $22996820477a6820$var$RequestScheduler.throttleRequests = true;\n/**\n * When true, log statistics to the console every frame\n * @type {boolean}\n * @default false\n * @private\n */ $22996820477a6820$var$RequestScheduler.debugShowStatistics = false;\n/**\n * An event that's raised when a request is completed. Event handlers are passed\n * the error object if the request fails.\n *\n * @type {Event}\n * @default Event()\n * @private\n */ $22996820477a6820$var$RequestScheduler.requestCompletedEvent = $22996820477a6820$var$requestCompletedEvent;\nObject.defineProperties($22996820477a6820$var$RequestScheduler, {\n /**\n * Returns the statistics used by the request scheduler.\n *\n * @memberof RequestScheduler\n *\n * @type {object}\n * @readonly\n * @private\n */ statistics: {\n get: function() {\n return $22996820477a6820$var$statistics;\n }\n },\n /**\n * The maximum size of the priority heap. This limits the number of requests that are sorted by priority. Only applies to requests that are not yet active.\n *\n * @memberof RequestScheduler\n *\n * @type {number}\n * @default 20\n * @private\n */ priorityHeapLength: {\n get: function() {\n return $22996820477a6820$var$priorityHeapLength;\n },\n set: function(value) {\n // If the new length shrinks the heap, need to cancel some of the requests.\n // Since this value is not intended to be tweaked regularly it is fine to just cancel the high priority requests.\n if (value < $22996820477a6820$var$priorityHeapLength) while($22996820477a6820$var$requestHeap.length > value){\n const request = $22996820477a6820$var$requestHeap.pop();\n $22996820477a6820$var$cancelRequest(request);\n }\n $22996820477a6820$var$priorityHeapLength = value;\n $22996820477a6820$var$requestHeap.maximumLength = value;\n $22996820477a6820$var$requestHeap.reserve(value);\n }\n }\n});\nfunction $22996820477a6820$var$updatePriority(request) {\n if ((0, $jQJji.default)(request.priorityFunction)) request.priority = request.priorityFunction();\n}\n/**\n * Check if there are open slots for a particular server key. If desiredRequests is greater than 1, this checks if the queue has room for scheduling multiple requests.\n * @param {string} serverKey The server key returned by {@link RequestScheduler.getServerKey}.\n * @param {number} [desiredRequests=1] How many requests the caller plans to request\n * @return {boolean} True if there are enough open slots for desiredRequests
more requests.\n * @private\n */ $22996820477a6820$var$RequestScheduler.serverHasOpenSlots = function(serverKey, desiredRequests) {\n desiredRequests = (0, $8w8ZH.default)(desiredRequests, 1);\n const maxRequests = (0, $8w8ZH.default)($22996820477a6820$var$RequestScheduler.requestsByServer[serverKey], $22996820477a6820$var$RequestScheduler.maximumRequestsPerServer);\n const hasOpenSlotsServer = $22996820477a6820$var$numberOfActiveRequestsByServer[serverKey] + desiredRequests <= maxRequests;\n return hasOpenSlotsServer;\n};\n/**\n * Check if the priority heap has open slots, regardless of which server they\n * are from. This is used in {@link Multiple3DTileContent} for determining when\n * all requests can be scheduled\n * @param {number} desiredRequests The number of requests the caller intends to make\n * @return {boolean} true
if the heap has enough available slots to meet the desiredRequests. false
otherwise.\n *\n * @private\n */ $22996820477a6820$var$RequestScheduler.heapHasOpenSlots = function(desiredRequests) {\n const hasOpenSlotsHeap = $22996820477a6820$var$requestHeap.length + desiredRequests <= $22996820477a6820$var$priorityHeapLength;\n return hasOpenSlotsHeap;\n};\nfunction $22996820477a6820$var$issueRequest(request) {\n if (request.state === (0, $3f5372c4ce85d94e$export$2e2bcd8739ae039).UNISSUED) {\n request.state = (0, $3f5372c4ce85d94e$export$2e2bcd8739ae039).ISSUED;\n request.deferred = (0, $6e11a2ab1ac0872e$export$2e2bcd8739ae039)();\n }\n return request.deferred.promise;\n}\nfunction $22996820477a6820$var$getRequestReceivedFunction(request) {\n return function(results) {\n if (request.state === (0, $3f5372c4ce85d94e$export$2e2bcd8739ae039).CANCELLED) // If the data request comes back but the request is cancelled, ignore it.\n return;\n // explicitly set to undefined to ensure GC of request response data. See #8843\n const deferred = request.deferred;\n --$22996820477a6820$var$statistics.numberOfActiveRequests;\n --$22996820477a6820$var$numberOfActiveRequestsByServer[request.serverKey];\n $22996820477a6820$var$requestCompletedEvent.raiseEvent();\n request.state = (0, $3f5372c4ce85d94e$export$2e2bcd8739ae039).RECEIVED;\n request.deferred = undefined;\n deferred.resolve(results);\n };\n}\nfunction $22996820477a6820$var$getRequestFailedFunction(request) {\n return function(error) {\n if (request.state === (0, $3f5372c4ce85d94e$export$2e2bcd8739ae039).CANCELLED) // If the data request comes back but the request is cancelled, ignore it.\n return;\n ++$22996820477a6820$var$statistics.numberOfFailedRequests;\n --$22996820477a6820$var$statistics.numberOfActiveRequests;\n --$22996820477a6820$var$numberOfActiveRequestsByServer[request.serverKey];\n $22996820477a6820$var$requestCompletedEvent.raiseEvent(error);\n request.state = (0, $3f5372c4ce85d94e$export$2e2bcd8739ae039).FAILED;\n request.deferred.reject(error);\n };\n}\nfunction $22996820477a6820$var$startRequest(request) {\n const promise = $22996820477a6820$var$issueRequest(request);\n request.state = (0, $3f5372c4ce85d94e$export$2e2bcd8739ae039).ACTIVE;\n $22996820477a6820$var$activeRequests.push(request);\n ++$22996820477a6820$var$statistics.numberOfActiveRequests;\n ++$22996820477a6820$var$statistics.numberOfActiveRequestsEver;\n ++$22996820477a6820$var$numberOfActiveRequestsByServer[request.serverKey];\n request.requestFunction().then($22996820477a6820$var$getRequestReceivedFunction(request)).catch($22996820477a6820$var$getRequestFailedFunction(request));\n return promise;\n}\nfunction $22996820477a6820$var$cancelRequest(request) {\n const active = request.state === (0, $3f5372c4ce85d94e$export$2e2bcd8739ae039).ACTIVE;\n request.state = (0, $3f5372c4ce85d94e$export$2e2bcd8739ae039).CANCELLED;\n ++$22996820477a6820$var$statistics.numberOfCancelledRequests;\n // check that deferred has not been cleared since cancelRequest can be called\n // on a finished request, e.g. by clearForSpecs during tests\n if ((0, $jQJji.default)(request.deferred)) {\n const deferred = request.deferred;\n request.deferred = undefined;\n deferred.reject();\n }\n if (active) {\n --$22996820477a6820$var$statistics.numberOfActiveRequests;\n --$22996820477a6820$var$numberOfActiveRequestsByServer[request.serverKey];\n ++$22996820477a6820$var$statistics.numberOfCancelledActiveRequests;\n }\n if ((0, $jQJji.default)(request.cancelFunction)) request.cancelFunction();\n}\n/**\n * Sort requests by priority and start requests.\n * @private\n */ $22996820477a6820$var$RequestScheduler.update = function() {\n let i;\n let request;\n // Loop over all active requests. Cancelled, failed, or received requests are removed from the array to make room for new requests.\n let removeCount = 0;\n const activeLength = $22996820477a6820$var$activeRequests.length;\n for(i = 0; i < activeLength; ++i){\n request = $22996820477a6820$var$activeRequests[i];\n if (request.cancelled) // Request was explicitly cancelled\n $22996820477a6820$var$cancelRequest(request);\n if (request.state !== (0, $3f5372c4ce85d94e$export$2e2bcd8739ae039).ACTIVE) {\n // Request is no longer active, remove from array\n ++removeCount;\n continue;\n }\n if (removeCount > 0) // Shift back to fill in vacated slots from completed requests\n $22996820477a6820$var$activeRequests[i - removeCount] = request;\n }\n $22996820477a6820$var$activeRequests.length -= removeCount;\n // Update priority of issued requests and resort the heap\n const issuedRequests = $22996820477a6820$var$requestHeap.internalArray;\n const issuedLength = $22996820477a6820$var$requestHeap.length;\n for(i = 0; i < issuedLength; ++i)$22996820477a6820$var$updatePriority(issuedRequests[i]);\n $22996820477a6820$var$requestHeap.resort();\n // Get the number of open slots and fill with the highest priority requests.\n // Un-throttled requests are automatically added to activeRequests, so activeRequests.length may exceed maximumRequests\n const openSlots = Math.max($22996820477a6820$var$RequestScheduler.maximumRequests - $22996820477a6820$var$activeRequests.length, 0);\n let filledSlots = 0;\n while(filledSlots < openSlots && $22996820477a6820$var$requestHeap.length > 0){\n // Loop until all open slots are filled or the heap becomes empty\n request = $22996820477a6820$var$requestHeap.pop();\n if (request.cancelled) {\n // Request was explicitly cancelled\n $22996820477a6820$var$cancelRequest(request);\n continue;\n }\n if (request.throttleByServer && !$22996820477a6820$var$RequestScheduler.serverHasOpenSlots(request.serverKey)) {\n // Open slots are available, but the request is throttled by its server. Cancel and try again later.\n $22996820477a6820$var$cancelRequest(request);\n continue;\n }\n $22996820477a6820$var$startRequest(request);\n ++filledSlots;\n }\n $22996820477a6820$var$updateStatistics();\n};\n/**\n * Get the server key from a given url.\n *\n * @param {string} url The url.\n * @returns {string} The server key.\n * @private\n */ $22996820477a6820$var$RequestScheduler.getServerKey = function(url) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.string(\"url\", url);\n //>>includeEnd('debug');\n let uri = new (0, (/*@__PURE__*/$parcel$interopDefault($f3b7c43a7f0c8e85$exports)))(url);\n if (uri.scheme() === \"\") {\n uri = uri.absoluteTo($22996820477a6820$var$pageUri);\n uri.normalize();\n }\n let serverKey = uri.authority();\n if (!/:/.test(serverKey)) // If the authority does not contain a port number, add port 443 for https or port 80 for http\n serverKey = `${serverKey}:${uri.scheme() === \"https\" ? \"443\" : \"80\"}`;\n const length = $22996820477a6820$var$numberOfActiveRequestsByServer[serverKey];\n if (!(0, $jQJji.default)(length)) $22996820477a6820$var$numberOfActiveRequestsByServer[serverKey] = 0;\n return serverKey;\n};\n/**\n * Issue a request. If request.throttle is false, the request is sent immediately. Otherwise the request will be\n * queued and sorted by priority before being sent.\n *\n * @param {Request} request The request object.\n *\n * @returns {Promise|undefined} A Promise for the requested data, or undefined if this request does not have high enough priority to be issued.\n *\n * @private\n */ $22996820477a6820$var$RequestScheduler.request = function(request) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.object(\"request\", request);\n (0, $3pzcG.default).typeOf.string(\"request.url\", request.url);\n (0, $3pzcG.default).typeOf.func(\"request.requestFunction\", request.requestFunction);\n //>>includeEnd('debug');\n if ((0, $9cb2c183cad552bd$export$2e2bcd8739ae039)(request.url) || (0, $9f0272ac2370f543$export$2e2bcd8739ae039)(request.url)) {\n $22996820477a6820$var$requestCompletedEvent.raiseEvent();\n request.state = (0, $3f5372c4ce85d94e$export$2e2bcd8739ae039).RECEIVED;\n return request.requestFunction();\n }\n ++$22996820477a6820$var$statistics.numberOfAttemptedRequests;\n if (!(0, $jQJji.default)(request.serverKey)) request.serverKey = $22996820477a6820$var$RequestScheduler.getServerKey(request.url);\n if ($22996820477a6820$var$RequestScheduler.throttleRequests && request.throttleByServer && !$22996820477a6820$var$RequestScheduler.serverHasOpenSlots(request.serverKey)) // Server is saturated. Try again later.\n return undefined;\n if (!$22996820477a6820$var$RequestScheduler.throttleRequests || !request.throttle) return $22996820477a6820$var$startRequest(request);\n if ($22996820477a6820$var$activeRequests.length >= $22996820477a6820$var$RequestScheduler.maximumRequests) // Active requests are saturated. Try again later.\n return undefined;\n // Insert into the priority heap and see if a request was bumped off. If this request is the lowest\n // priority it will be returned.\n $22996820477a6820$var$updatePriority(request);\n const removedRequest = $22996820477a6820$var$requestHeap.insert(request);\n if ((0, $jQJji.default)(removedRequest)) {\n if (removedRequest === request) // Request does not have high enough priority to be issued\n return undefined;\n // A previously issued request has been bumped off the priority heap, so cancel it\n $22996820477a6820$var$cancelRequest(removedRequest);\n }\n return $22996820477a6820$var$issueRequest(request);\n};\nfunction $22996820477a6820$var$updateStatistics() {\n if (!$22996820477a6820$var$RequestScheduler.debugShowStatistics) return;\n if ($22996820477a6820$var$statistics.numberOfActiveRequests === 0 && $22996820477a6820$var$statistics.lastNumberOfActiveRequests > 0) {\n if ($22996820477a6820$var$statistics.numberOfAttemptedRequests > 0) {\n console.log(`Number of attempted requests: ${$22996820477a6820$var$statistics.numberOfAttemptedRequests}`);\n $22996820477a6820$var$statistics.numberOfAttemptedRequests = 0;\n }\n if ($22996820477a6820$var$statistics.numberOfCancelledRequests > 0) {\n console.log(`Number of cancelled requests: ${$22996820477a6820$var$statistics.numberOfCancelledRequests}`);\n $22996820477a6820$var$statistics.numberOfCancelledRequests = 0;\n }\n if ($22996820477a6820$var$statistics.numberOfCancelledActiveRequests > 0) {\n console.log(`Number of cancelled active requests: ${$22996820477a6820$var$statistics.numberOfCancelledActiveRequests}`);\n $22996820477a6820$var$statistics.numberOfCancelledActiveRequests = 0;\n }\n if ($22996820477a6820$var$statistics.numberOfFailedRequests > 0) {\n console.log(`Number of failed requests: ${$22996820477a6820$var$statistics.numberOfFailedRequests}`);\n $22996820477a6820$var$statistics.numberOfFailedRequests = 0;\n }\n }\n $22996820477a6820$var$statistics.lastNumberOfActiveRequests = $22996820477a6820$var$statistics.numberOfActiveRequests;\n}\n/**\n * For testing only. Clears any requests that may not have completed from previous tests.\n *\n * @private\n */ $22996820477a6820$var$RequestScheduler.clearForSpecs = function() {\n while($22996820477a6820$var$requestHeap.length > 0){\n const request = $22996820477a6820$var$requestHeap.pop();\n $22996820477a6820$var$cancelRequest(request);\n }\n const length = $22996820477a6820$var$activeRequests.length;\n for(let i = 0; i < length; ++i)$22996820477a6820$var$cancelRequest($22996820477a6820$var$activeRequests[i]);\n $22996820477a6820$var$activeRequests.length = 0;\n $22996820477a6820$var$numberOfActiveRequestsByServer = {};\n // Clear stats\n $22996820477a6820$var$statistics.numberOfAttemptedRequests = 0;\n $22996820477a6820$var$statistics.numberOfActiveRequests = 0;\n $22996820477a6820$var$statistics.numberOfCancelledRequests = 0;\n $22996820477a6820$var$statistics.numberOfCancelledActiveRequests = 0;\n $22996820477a6820$var$statistics.numberOfFailedRequests = 0;\n $22996820477a6820$var$statistics.numberOfActiveRequestsEver = 0;\n $22996820477a6820$var$statistics.lastNumberOfActiveRequests = 0;\n};\n/**\n * For testing only.\n *\n * @private\n */ $22996820477a6820$var$RequestScheduler.numberOfActiveRequestsByServer = function(serverKey) {\n return $22996820477a6820$var$numberOfActiveRequestsByServer[serverKey];\n};\n/**\n * For testing only.\n *\n * @private\n */ $22996820477a6820$var$RequestScheduler.requestHeap = $22996820477a6820$var$requestHeap;\nvar $22996820477a6820$export$2e2bcd8739ae039 = $22996820477a6820$var$RequestScheduler;\n\n\n\n\n\n\nvar $jQJji = parcelRequire(\"jQJji\");\n\nvar $1vHsR = parcelRequire(\"1vHsR\");\n/**\n * A singleton that contains all of the servers that are trusted. Credentials will be sent with\n * any requests to these servers.\n *\n * @namespace TrustedServers\n *\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n */ const $501f833019c34c9b$var$TrustedServers = {};\nlet $501f833019c34c9b$var$_servers = {};\n/**\n * Adds a trusted server to the registry\n *\n * @param {string} host The host to be added.\n * @param {number} port The port used to access the host.\n *\n * @example\n * // Add a trusted server\n * TrustedServers.add('my.server.com', 80);\n */ $501f833019c34c9b$var$TrustedServers.add = function(host, port) {\n //>>includeStart('debug', pragmas.debug);\n if (!(0, $jQJji.default)(host)) throw new (0, $1vHsR.default)(\"host is required.\");\n if (!(0, $jQJji.default)(port) || port <= 0) throw new (0, $1vHsR.default)(\"port is required to be greater than 0.\");\n //>>includeEnd('debug');\n const authority = `${host.toLowerCase()}:${port}`;\n if (!(0, $jQJji.default)($501f833019c34c9b$var$_servers[authority])) $501f833019c34c9b$var$_servers[authority] = true;\n};\n/**\n * Removes a trusted server from the registry\n *\n * @param {string} host The host to be removed.\n * @param {number} port The port used to access the host.\n *\n * @example\n * // Remove a trusted server\n * TrustedServers.remove('my.server.com', 80);\n */ $501f833019c34c9b$var$TrustedServers.remove = function(host, port) {\n //>>includeStart('debug', pragmas.debug);\n if (!(0, $jQJji.default)(host)) throw new (0, $1vHsR.default)(\"host is required.\");\n if (!(0, $jQJji.default)(port) || port <= 0) throw new (0, $1vHsR.default)(\"port is required to be greater than 0.\");\n //>>includeEnd('debug');\n const authority = `${host.toLowerCase()}:${port}`;\n if ((0, $jQJji.default)($501f833019c34c9b$var$_servers[authority])) delete $501f833019c34c9b$var$_servers[authority];\n};\nfunction $501f833019c34c9b$var$getAuthority(url) {\n const uri = new (0, (/*@__PURE__*/$parcel$interopDefault($f3b7c43a7f0c8e85$exports)))(url);\n uri.normalize();\n // Removes username:password@ so we just have host[:port]\n let authority = uri.authority();\n if (authority.length === 0) return undefined; // Relative URL\n uri.authority(authority);\n if (authority.indexOf(\"@\") !== -1) {\n const parts = authority.split(\"@\");\n authority = parts[1];\n }\n // If the port is missing add one based on the scheme\n if (authority.indexOf(\":\") === -1) {\n let scheme = uri.scheme();\n if (scheme.length === 0) {\n scheme = window.location.protocol;\n scheme = scheme.substring(0, scheme.length - 1);\n }\n if (scheme === \"http\") authority += \":80\";\n else if (scheme === \"https\") authority += \":443\";\n else return undefined;\n }\n return authority;\n}\n/**\n * Tests whether a server is trusted or not. The server must have been added with the port if it is included in the url.\n *\n * @param {string} url The url to be tested against the trusted list\n *\n * @returns {boolean} Returns true if url is trusted, false otherwise.\n *\n * @example\n * // Add server\n * TrustedServers.add('my.server.com', 81);\n *\n * // Check if server is trusted\n * if (TrustedServers.contains('https://my.server.com:81/path/to/file.png')) {\n * // my.server.com:81 is trusted\n * }\n * if (TrustedServers.contains('https://my.server.com/path/to/file.png')) {\n * // my.server.com isn't trusted\n * }\n */ $501f833019c34c9b$var$TrustedServers.contains = function(url) {\n //>>includeStart('debug', pragmas.debug);\n if (!(0, $jQJji.default)(url)) throw new (0, $1vHsR.default)(\"url is required.\");\n //>>includeEnd('debug');\n const authority = $501f833019c34c9b$var$getAuthority(url);\n if ((0, $jQJji.default)(authority) && (0, $jQJji.default)($501f833019c34c9b$var$_servers[authority])) return true;\n return false;\n};\n/**\n * Clears the registry\n *\n * @example\n * // Remove a trusted server\n * TrustedServers.clear();\n */ $501f833019c34c9b$var$TrustedServers.clear = function() {\n $501f833019c34c9b$var$_servers = {};\n};\nvar $501f833019c34c9b$export$2e2bcd8739ae039 = $501f833019c34c9b$var$TrustedServers;\n\n\nconst $b1dcbeb8d31d71ff$var$xhrBlobSupported = function() {\n try {\n const xhr = new XMLHttpRequest();\n xhr.open(\"GET\", \"#\", true);\n xhr.responseType = \"blob\";\n return xhr.responseType === \"blob\";\n } catch (e) {\n return false;\n }\n}();\n/**\n * @typedef {object} Resource.ConstructorOptions\n *\n * Initialization options for the Resource constructor\n *\n * @property {string} url The url of the resource.\n * @property {object} [queryParameters] An object containing query parameters that will be sent when retrieving the resource.\n * @property {object} [templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\n * @property {object} [headers={}] Additional HTTP headers that will be sent.\n * @property {Proxy} [proxy] A proxy to be used when loading the resource.\n * @property {Resource.RetryCallback} [retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\n * @property {number} [retryAttempts=0] The number of times the retryCallback should be called before giving up.\n * @property {Request} [request] A Request object that will be used. Intended for internal use only.\n * @property {boolean} [parseUrl=true] If true, parse the url for query parameters; otherwise store the url without change\n */ /**\n * 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.\n *\n * @alias Resource\n * @constructor\n *\n * @param {string|Resource.ConstructorOptions} options A url or an object describing initialization options\n *\n * @example\n * function refreshTokenRetryCallback(resource, error) {\n * if (error.statusCode === 403) {\n * // 403 status code means a new token should be generated\n * return getNewAccessToken()\n * .then(function(token) {\n * resource.queryParameters.access_token = token;\n * return true;\n * })\n * .catch(function() {\n * return false;\n * });\n * }\n *\n * return false;\n * }\n *\n * const resource = new Resource({\n * url: 'http://server.com/path/to/resource.json',\n * proxy: new DefaultProxy('/proxy/'),\n * headers: {\n * 'X-My-Header': 'valueOfHeader'\n * },\n * queryParameters: {\n * 'access_token': '123-435-456-000'\n * },\n * retryCallback: refreshTokenRetryCallback,\n * retryAttempts: 1\n * });\n */ function $b1dcbeb8d31d71ff$var$Resource(options) {\n options = (0, $8w8ZH.default)(options, (0, $8w8ZH.default).EMPTY_OBJECT);\n if (typeof options === \"string\") options = {\n url: options\n };\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.string(\"options.url\", options.url);\n //>>includeEnd('debug');\n this._url = undefined;\n this._templateValues = $b1dcbeb8d31d71ff$var$defaultClone(options.templateValues, {});\n this._queryParameters = $b1dcbeb8d31d71ff$var$defaultClone(options.queryParameters, {});\n /**\n * Additional HTTP headers that will be sent with the request.\n *\n * @type {object}\n */ this.headers = $b1dcbeb8d31d71ff$var$defaultClone(options.headers, {});\n /**\n * A Request object that will be used. Intended for internal use only.\n *\n * @type {Request}\n */ this.request = (0, $8w8ZH.default)(options.request, new (0, $b1445a5361079efc$export$2e2bcd8739ae039)());\n /**\n * A proxy to be used when loading the resource.\n *\n * @type {Proxy}\n */ this.proxy = options.proxy;\n /**\n * 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.\n *\n * @type {Function}\n */ this.retryCallback = options.retryCallback;\n /**\n * The number of times the retryCallback should be called before giving up.\n *\n * @type {number}\n */ this.retryAttempts = (0, $8w8ZH.default)(options.retryAttempts, 0);\n this._retryCount = 0;\n const parseUrl = (0, $8w8ZH.default)(options.parseUrl, true);\n if (parseUrl) this.parseUrl(options.url, true, true);\n else this._url = options.url;\n this._credits = options.credits;\n}\n/**\n * Clones a value if it is defined, otherwise returns the default value\n *\n * @param {object} [value] The value to clone.\n * @param {object} [defaultValue] The default value.\n *\n * @returns {object} A clone of value or the defaultValue.\n *\n * @private\n */ function $b1dcbeb8d31d71ff$var$defaultClone(value, defaultValue) {\n return (0, $jQJji.default)(value) ? (0, $3f52ff37d0636f55$export$2e2bcd8739ae039)(value) : defaultValue;\n}\n/**\n * A helper function to create a resource depending on whether we have a String or a Resource\n *\n * @param {Resource|string} resource A Resource or a String to use when creating a new Resource.\n *\n * @returns {Resource} If resource is a String, a Resource constructed with the url and options. Otherwise the resource parameter is returned.\n *\n * @private\n */ $b1dcbeb8d31d71ff$var$Resource.createIfNeeded = function(resource) {\n if (resource instanceof $b1dcbeb8d31d71ff$var$Resource) // Keep existing request object. This function is used internally to duplicate a Resource, so that it can't\n // be modified outside of a class that holds it (eg. an imagery or terrain provider). Since the Request objects\n // are managed outside of the providers, by the tile loading code, we want to keep the request property the same so if it is changed\n // in the underlying tiling code the requests for this resource will use it.\n return resource.getDerivedResource({\n request: resource.request\n });\n if (typeof resource !== \"string\") return resource;\n return new $b1dcbeb8d31d71ff$var$Resource({\n url: resource\n });\n};\nlet $b1dcbeb8d31d71ff$var$supportsImageBitmapOptionsPromise;\n/**\n * A helper function to check whether createImageBitmap supports passing ImageBitmapOptions.\n *\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n *\n * @example\n * // load a single URL asynchronously\n * resource.fetchArrayBuffer().then(function(arrayBuffer) {\n * // use the data\n * }).catch(function(error) {\n * // an error occurred\n * });\n *\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\n */ $b1dcbeb8d31d71ff$var$Resource.prototype.fetchArrayBuffer = function() {\n return this.fetch({\n responseType: \"arraybuffer\"\n });\n};\n/**\n * Creates a Resource and calls fetchArrayBuffer() on it.\n *\n * @param {string|object} options A url or an object with the following properties\n * @param {string} options.url The url of the resource.\n * @param {object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\n * @param {object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\n * @param {object} [options.headers={}] Additional HTTP headers that will be sent.\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\n * @param {number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n */ $b1dcbeb8d31d71ff$var$Resource.fetchArrayBuffer = function(options) {\n const resource = new $b1dcbeb8d31d71ff$var$Resource(options);\n return resource.fetchArrayBuffer();\n};\n/**\n * Asynchronously loads the given resource as a blob. Returns a promise that will resolve to\n * a Blob once loaded, or reject if the resource failed to load. The data is loaded\n * using XMLHttpRequest, which means that in order to make requests to another origin,\n * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.\n *\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n *\n * @example\n * // load a single URL asynchronously\n * resource.fetchBlob().then(function(blob) {\n * // use the data\n * }).catch(function(error) {\n * // an error occurred\n * });\n *\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\n */ $b1dcbeb8d31d71ff$var$Resource.prototype.fetchBlob = function() {\n return this.fetch({\n responseType: \"blob\"\n });\n};\n/**\n * Creates a Resource and calls fetchBlob() on it.\n *\n * @param {string|object} options A url or an object with the following properties\n * @param {string} options.url The url of the resource.\n * @param {object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\n * @param {object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\n * @param {object} [options.headers={}] Additional HTTP headers that will be sent.\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\n * @param {number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n */ $b1dcbeb8d31d71ff$var$Resource.fetchBlob = function(options) {\n const resource = new $b1dcbeb8d31d71ff$var$Resource(options);\n return resource.fetchBlob();\n};\n/**\n * Asynchronously loads the given image resource. Returns a promise that will resolve to\n * 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\n * {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement|Image} once loaded, or reject if the image failed to load.\n *\n * @param {object} [options] An object with the following properties.\n * @param {boolean} [options.preferBlob=false] If true, we will load the image via a blob.\n * @param {boolean} [options.preferImageBitmap=false] If true, image will be decoded during fetch and an ImageBitmap
is returned.\n * @param {boolean} [options.flipY=false] If true, image will be vertically flipped during decode. Only applies if the browser supports createImageBitmap
.\n * @param {boolean} [options.skipColorSpaceConversion=false] If true, any custom gamma or color profiles in the image will be ignored. Only applies if the browser supports createImageBitmap
.\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n *\n *\n * @example\n * // load a single image asynchronously\n * resource.fetchImage().then(function(image) {\n * // use the loaded image\n * }).catch(function(error) {\n * // an error occurred\n * });\n *\n * // load several images in parallel\n * Promise.all([resource1.fetchImage(), resource2.fetchImage()]).then(function(images) {\n * // images is an array containing all the loaded images\n * });\n *\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\n */ $b1dcbeb8d31d71ff$var$Resource.prototype.fetchImage = function(options) {\n options = (0, $8w8ZH.default)(options, (0, $8w8ZH.default).EMPTY_OBJECT);\n const preferImageBitmap = (0, $8w8ZH.default)(options.preferImageBitmap, false);\n const preferBlob = (0, $8w8ZH.default)(options.preferBlob, false);\n const flipY = (0, $8w8ZH.default)(options.flipY, false);\n const skipColorSpaceConversion = (0, $8w8ZH.default)(options.skipColorSpaceConversion, false);\n $b1dcbeb8d31d71ff$var$checkAndResetRequest(this.request);\n // We try to load the image normally if\n // 1. Blobs aren't supported\n // 2. It's a data URI\n // 3. It's a blob URI\n // 4. It doesn't have request headers and we preferBlob is false\n if (!$b1dcbeb8d31d71ff$var$xhrBlobSupported || this.isDataUri || this.isBlobUri || !this.hasHeaders && !preferBlob) return $b1dcbeb8d31d71ff$var$fetchImage({\n resource: this,\n flipY: flipY,\n skipColorSpaceConversion: skipColorSpaceConversion,\n preferImageBitmap: preferImageBitmap\n });\n const blobPromise = this.fetchBlob();\n if (!(0, $jQJji.default)(blobPromise)) return;\n let supportsImageBitmap;\n let useImageBitmap;\n let generatedBlobResource;\n let generatedBlob;\n return $b1dcbeb8d31d71ff$var$Resource.supportsImageBitmapOptions().then(function(result) {\n supportsImageBitmap = result;\n useImageBitmap = supportsImageBitmap && preferImageBitmap;\n return blobPromise;\n }).then(function(blob) {\n if (!(0, $jQJji.default)(blob)) return;\n generatedBlob = blob;\n if (useImageBitmap) return $b1dcbeb8d31d71ff$var$Resource.createImageBitmapFromBlob(blob, {\n flipY: flipY,\n premultiplyAlpha: false,\n skipColorSpaceConversion: skipColorSpaceConversion\n });\n const blobUrl = window.URL.createObjectURL(blob);\n generatedBlobResource = new $b1dcbeb8d31d71ff$var$Resource({\n url: blobUrl\n });\n return $b1dcbeb8d31d71ff$var$fetchImage({\n resource: generatedBlobResource,\n flipY: flipY,\n skipColorSpaceConversion: skipColorSpaceConversion,\n preferImageBitmap: false\n });\n }).then(function(image) {\n if (!(0, $jQJji.default)(image)) return;\n // The blob object may be needed for use by a TileDiscardPolicy,\n // so attach it to the image.\n image.blob = generatedBlob;\n if (useImageBitmap) return image;\n window.URL.revokeObjectURL(generatedBlobResource.url);\n return image;\n }).catch(function(error) {\n if ((0, $jQJji.default)(generatedBlobResource)) window.URL.revokeObjectURL(generatedBlobResource.url);\n // If the blob load succeeded but the image decode failed, attach the blob\n // to the error object for use by a TileDiscardPolicy.\n // In particular, BingMapsImageryProvider uses this to detect the\n // zero-length response that is returned when a tile is not available.\n error.blob = generatedBlob;\n return Promise.reject(error);\n });\n};\n/**\n * Fetches an image and returns a promise to it.\n *\n * @param {object} [options] An object with the following properties.\n * @param {Resource} [options.resource] Resource object that points to an image to fetch.\n * @param {boolean} [options.preferImageBitmap] If true, image will be decoded during fetch and an ImageBitmap
is returned.\n * @param {boolean} [options.flipY] If true, image will be vertically flipped during decode. Only applies if the browser supports createImageBitmap
.\n * @param {boolean} [options.skipColorSpaceConversion=false] If true, any custom gamma or color profiles in the image will be ignored. Only applies if the browser supports createImageBitmap
.\n * @private\n */ function $b1dcbeb8d31d71ff$var$fetchImage(options) {\n const resource = options.resource;\n const flipY = options.flipY;\n const skipColorSpaceConversion = options.skipColorSpaceConversion;\n const preferImageBitmap = options.preferImageBitmap;\n const request = resource.request;\n request.url = resource.url;\n request.requestFunction = function() {\n let crossOrigin = false;\n // data URIs can't have crossorigin set.\n if (!resource.isDataUri && !resource.isBlobUri) crossOrigin = resource.isCrossOriginUrl;\n const deferred = (0, $6e11a2ab1ac0872e$export$2e2bcd8739ae039)();\n $b1dcbeb8d31d71ff$var$Resource._Implementations.createImage(request, crossOrigin, deferred, flipY, skipColorSpaceConversion, preferImageBitmap);\n return deferred.promise;\n };\n const promise = (0, $22996820477a6820$export$2e2bcd8739ae039).request(request);\n if (!(0, $jQJji.default)(promise)) return;\n return promise.catch(function(e) {\n // Don't retry cancelled or otherwise aborted requests\n if (request.state !== (0, $3f5372c4ce85d94e$export$2e2bcd8739ae039).FAILED) return Promise.reject(e);\n return resource.retryOnError(e).then(function(retry) {\n if (retry) {\n // Reset request so it can try again\n request.state = (0, $3f5372c4ce85d94e$export$2e2bcd8739ae039).UNISSUED;\n request.deferred = undefined;\n return $b1dcbeb8d31d71ff$var$fetchImage({\n resource: resource,\n flipY: flipY,\n skipColorSpaceConversion: skipColorSpaceConversion,\n preferImageBitmap: preferImageBitmap\n });\n }\n return Promise.reject(e);\n });\n });\n}\n/**\n * Creates a Resource and calls fetchImage() on it.\n *\n * @param {string|object} options A url or an object with the following properties\n * @param {string} options.url The url of the resource.\n * @param {object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\n * @param {object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\n * @param {object} [options.headers={}] Additional HTTP headers that will be sent.\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\n * @param {boolean} [options.flipY=false] Whether to vertically flip the image during fetch and decode. Only applies when requesting an image and the browser supports createImageBitmap
.\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\n * @param {number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\n * @param {boolean} [options.preferBlob=false] If true, we will load the image via a blob.\n * @param {boolean} [options.preferImageBitmap=false] If true, image will be decoded during fetch and an ImageBitmap
is returned.\n * @param {boolean} [options.skipColorSpaceConversion=false] If true, any custom gamma or color profiles in the image will be ignored. Only applies when requesting an image and the browser supports createImageBitmap
.\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n */ $b1dcbeb8d31d71ff$var$Resource.fetchImage = function(options) {\n const resource = new $b1dcbeb8d31d71ff$var$Resource(options);\n return resource.fetchImage({\n flipY: options.flipY,\n skipColorSpaceConversion: options.skipColorSpaceConversion,\n preferBlob: options.preferBlob,\n preferImageBitmap: options.preferImageBitmap\n });\n};\n/**\n * Asynchronously loads the given resource as text. Returns a promise that will resolve to\n * a String once loaded, or reject if the resource failed to load. The data is loaded\n * using XMLHttpRequest, which means that in order to make requests to another origin,\n * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.\n *\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n *\n * @example\n * // load text from a URL, setting a custom header\n * const resource = new Resource({\n * url: 'http://someUrl.com/someJson.txt',\n * headers: {\n * 'X-Custom-Header' : 'some value'\n * }\n * });\n * resource.fetchText().then(function(text) {\n * // Do something with the text\n * }).catch(function(error) {\n * // an error occurred\n * });\n *\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest|XMLHttpRequest}\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\n */ $b1dcbeb8d31d71ff$var$Resource.prototype.fetchText = function() {\n return this.fetch({\n responseType: \"text\"\n });\n};\n/**\n * Creates a Resource and calls fetchText() on it.\n *\n * @param {string|object} options A url or an object with the following properties\n * @param {string} options.url The url of the resource.\n * @param {object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\n * @param {object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\n * @param {object} [options.headers={}] Additional HTTP headers that will be sent.\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\n * @param {number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n */ $b1dcbeb8d31d71ff$var$Resource.fetchText = function(options) {\n const resource = new $b1dcbeb8d31d71ff$var$Resource(options);\n return resource.fetchText();\n};\n// note: */* below is */* but that ends the comment block early\n/**\n * Asynchronously loads the given resource as JSON. Returns a promise that will resolve to\n * a JSON object once loaded, or reject if the resource failed to load. The data is loaded\n * using XMLHttpRequest, which means that in order to make requests to another origin,\n * the server must have Cross-Origin Resource Sharing (CORS) headers enabled. This function\n * adds 'Accept: application/json,*/*;q=0.01' to the request headers, if not\n * already specified.\n *\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n *\n *\n * @example\n * resource.fetchJson().then(function(jsonData) {\n * // Do something with the JSON object\n * }).catch(function(error) {\n * // an error occurred\n * });\n *\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\n */ $b1dcbeb8d31d71ff$var$Resource.prototype.fetchJson = function() {\n const promise = this.fetch({\n responseType: \"text\",\n headers: {\n Accept: \"application/json,*/*;q=0.01\"\n }\n });\n if (!(0, $jQJji.default)(promise)) return undefined;\n return promise.then(function(value) {\n if (!(0, $jQJji.default)(value)) return;\n return JSON.parse(value);\n });\n};\n/**\n * Creates a Resource and calls fetchJson() on it.\n *\n * @param {string|object} options A url or an object with the following properties\n * @param {string} options.url The url of the resource.\n * @param {object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\n * @param {object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\n * @param {object} [options.headers={}] Additional HTTP headers that will be sent.\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\n * @param {number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n */ $b1dcbeb8d31d71ff$var$Resource.fetchJson = function(options) {\n const resource = new $b1dcbeb8d31d71ff$var$Resource(options);\n return resource.fetchJson();\n};\n/**\n * Asynchronously loads the given resource as XML. Returns a promise that will resolve to\n * an XML Document once loaded, or reject if the resource failed to load. The data is loaded\n * using XMLHttpRequest, which means that in order to make requests to another origin,\n * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.\n *\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n *\n *\n * @example\n * // load XML from a URL, setting a custom header\n * Cesium.loadXML('http://someUrl.com/someXML.xml', {\n * 'X-Custom-Header' : 'some value'\n * }).then(function(document) {\n * // Do something with the document\n * }).catch(function(error) {\n * // an error occurred\n * });\n *\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest|XMLHttpRequest}\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\n */ $b1dcbeb8d31d71ff$var$Resource.prototype.fetchXML = function() {\n return this.fetch({\n responseType: \"document\",\n overrideMimeType: \"text/xml\"\n });\n};\n/**\n * Creates a Resource and calls fetchXML() on it.\n *\n * @param {string|object} options A url or an object with the following properties\n * @param {string} options.url The url of the resource.\n * @param {object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\n * @param {object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\n * @param {object} [options.headers={}] Additional HTTP headers that will be sent.\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\n * @param {number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n */ $b1dcbeb8d31d71ff$var$Resource.fetchXML = function(options) {\n const resource = new $b1dcbeb8d31d71ff$var$Resource(options);\n return resource.fetchXML();\n};\n/**\n * Requests a resource using JSONP.\n *\n * @param {string} [callbackParameterName='callback'] The callback parameter name that the server expects.\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n *\n *\n * @example\n * // load a data asynchronously\n * resource.fetchJsonp().then(function(data) {\n * // use the loaded data\n * }).catch(function(error) {\n * // an error occurred\n * });\n *\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\n */ $b1dcbeb8d31d71ff$var$Resource.prototype.fetchJsonp = function(callbackParameterName) {\n callbackParameterName = (0, $8w8ZH.default)(callbackParameterName, \"callback\");\n $b1dcbeb8d31d71ff$var$checkAndResetRequest(this.request);\n //generate a unique function name\n let functionName;\n do functionName = `loadJsonp${(0, $AXvpI.default).nextRandomNumber().toString().substring(2, 8)}`;\n while ((0, $jQJji.default)(window[functionName]));\n return $b1dcbeb8d31d71ff$var$fetchJsonp(this, callbackParameterName, functionName);\n};\nfunction $b1dcbeb8d31d71ff$var$fetchJsonp(resource, callbackParameterName, functionName) {\n const callbackQuery = {};\n callbackQuery[callbackParameterName] = functionName;\n resource.setQueryParameters(callbackQuery);\n const request = resource.request;\n const url = resource.url;\n request.url = url;\n request.requestFunction = function() {\n const deferred = (0, $6e11a2ab1ac0872e$export$2e2bcd8739ae039)();\n //assign a function with that name in the global scope\n window[functionName] = function(data) {\n deferred.resolve(data);\n try {\n delete window[functionName];\n } catch (e) {\n window[functionName] = undefined;\n }\n };\n $b1dcbeb8d31d71ff$var$Resource._Implementations.loadAndExecuteScript(url, functionName, deferred);\n return deferred.promise;\n };\n const promise = (0, $22996820477a6820$export$2e2bcd8739ae039).request(request);\n if (!(0, $jQJji.default)(promise)) return;\n return promise.catch(function(e) {\n if (request.state !== (0, $3f5372c4ce85d94e$export$2e2bcd8739ae039).FAILED) return Promise.reject(e);\n return resource.retryOnError(e).then(function(retry) {\n if (retry) {\n // Reset request so it can try again\n request.state = (0, $3f5372c4ce85d94e$export$2e2bcd8739ae039).UNISSUED;\n request.deferred = undefined;\n return $b1dcbeb8d31d71ff$var$fetchJsonp(resource, callbackParameterName, functionName);\n }\n return Promise.reject(e);\n });\n });\n}\n/**\n * Creates a Resource from a URL and calls fetchJsonp() on it.\n *\n * @param {string|object} options A url or an object with the following properties\n * @param {string} options.url The url of the resource.\n * @param {object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\n * @param {object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\n * @param {object} [options.headers={}] Additional HTTP headers that will be sent.\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\n * @param {number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\n * @param {string} [options.callbackParameterName='callback'] The callback parameter name that the server expects.\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n */ $b1dcbeb8d31d71ff$var$Resource.fetchJsonp = function(options) {\n const resource = new $b1dcbeb8d31d71ff$var$Resource(options);\n return resource.fetchJsonp(options.callbackParameterName);\n};\n/**\n * @private\n */ $b1dcbeb8d31d71ff$var$Resource.prototype._makeRequest = function(options) {\n const resource = this;\n $b1dcbeb8d31d71ff$var$checkAndResetRequest(resource.request);\n const request = resource.request;\n const url = resource.url;\n request.url = url;\n request.requestFunction = function() {\n const responseType = options.responseType;\n const headers = (0, $8e522a73a8dfbfe2$export$2e2bcd8739ae039)(options.headers, resource.headers);\n const overrideMimeType = options.overrideMimeType;\n const method = options.method;\n const data = options.data;\n const deferred = (0, $6e11a2ab1ac0872e$export$2e2bcd8739ae039)();\n const xhr = $b1dcbeb8d31d71ff$var$Resource._Implementations.loadWithXhr(url, responseType, method, data, headers, deferred, overrideMimeType);\n if ((0, $jQJji.default)(xhr) && (0, $jQJji.default)(xhr.abort)) request.cancelFunction = function() {\n xhr.abort();\n };\n return deferred.promise;\n };\n const promise = (0, $22996820477a6820$export$2e2bcd8739ae039).request(request);\n if (!(0, $jQJji.default)(promise)) return;\n return promise.then(function(data) {\n // explicitly set to undefined to ensure GC of request response data. See #8843\n request.cancelFunction = undefined;\n return data;\n }).catch(function(e) {\n request.cancelFunction = undefined;\n if (request.state !== (0, $3f5372c4ce85d94e$export$2e2bcd8739ae039).FAILED) return Promise.reject(e);\n return resource.retryOnError(e).then(function(retry) {\n if (retry) {\n // Reset request so it can try again\n request.state = (0, $3f5372c4ce85d94e$export$2e2bcd8739ae039).UNISSUED;\n request.deferred = undefined;\n return resource.fetch(options);\n }\n return Promise.reject(e);\n });\n });\n};\n/**\n * Checks to make sure the Resource isn't already being requested.\n *\n * @param {Request} request The request to check.\n *\n * @private\n */ function $b1dcbeb8d31d71ff$var$checkAndResetRequest(request) {\n if (request.state === (0, $3f5372c4ce85d94e$export$2e2bcd8739ae039).ISSUED || request.state === (0, $3f5372c4ce85d94e$export$2e2bcd8739ae039).ACTIVE) throw new (0, $60086b06bf5db23f$export$2e2bcd8739ae039)(\"The Resource is already being fetched.\");\n request.state = (0, $3f5372c4ce85d94e$export$2e2bcd8739ae039).UNISSUED;\n request.deferred = undefined;\n}\nconst $b1dcbeb8d31d71ff$var$dataUriRegex = /^data:(.*?)(;base64)?,(.*)$/;\nfunction $b1dcbeb8d31d71ff$var$decodeDataUriText(isBase64, data) {\n const result = decodeURIComponent(data);\n if (isBase64) return atob(result);\n return result;\n}\nfunction $b1dcbeb8d31d71ff$var$decodeDataUriArrayBuffer(isBase64, data) {\n const byteString = $b1dcbeb8d31d71ff$var$decodeDataUriText(isBase64, data);\n const buffer = new ArrayBuffer(byteString.length);\n const view = new Uint8Array(buffer);\n for(let i = 0; i < byteString.length; i++)view[i] = byteString.charCodeAt(i);\n return buffer;\n}\nfunction $b1dcbeb8d31d71ff$var$decodeDataUri(dataUriRegexResult, responseType) {\n responseType = (0, $8w8ZH.default)(responseType, \"\");\n const mimeType = dataUriRegexResult[1];\n const isBase64 = !!dataUriRegexResult[2];\n const data = dataUriRegexResult[3];\n let buffer;\n let parser;\n switch(responseType){\n case \"\":\n case \"text\":\n return $b1dcbeb8d31d71ff$var$decodeDataUriText(isBase64, data);\n case \"arraybuffer\":\n return $b1dcbeb8d31d71ff$var$decodeDataUriArrayBuffer(isBase64, data);\n case \"blob\":\n buffer = $b1dcbeb8d31d71ff$var$decodeDataUriArrayBuffer(isBase64, data);\n return new Blob([\n buffer\n ], {\n type: mimeType\n });\n case \"document\":\n parser = new DOMParser();\n return parser.parseFromString($b1dcbeb8d31d71ff$var$decodeDataUriText(isBase64, data), mimeType);\n case \"json\":\n return JSON.parse($b1dcbeb8d31d71ff$var$decodeDataUriText(isBase64, data));\n default:\n //>>includeStart('debug', pragmas.debug);\n throw new (0, $1vHsR.default)(`Unhandled responseType: ${responseType}`);\n }\n}\n/**\n * Asynchronously loads the given resource. Returns a promise that will resolve to\n * the result once loaded, or reject if the resource failed to load. The data is loaded\n * using XMLHttpRequest, which means that in order to make requests to another origin,\n * the server must have Cross-Origin Resource Sharing (CORS) headers enabled. It's recommended that you use\n * the more specific functions eg. fetchJson, fetchBlob, etc.\n *\n * @param {object} [options] Object with the following properties:\n * @param {string} [options.responseType] The type of response. This controls the type of item returned.\n * @param {object} [options.headers] Additional HTTP headers to send with the request, if any.\n * @param {string} [options.overrideMimeType] Overrides the MIME type returned by the server.\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n *\n *\n * @example\n * resource.fetch()\n * .then(function(body) {\n * // use the data\n * }).catch(function(error) {\n * // an error occurred\n * });\n *\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\n */ $b1dcbeb8d31d71ff$var$Resource.prototype.fetch = function(options) {\n options = $b1dcbeb8d31d71ff$var$defaultClone(options, {});\n options.method = \"GET\";\n return this._makeRequest(options);\n};\n/**\n * Creates a Resource from a URL and calls fetch() on it.\n *\n * @param {string|object} options A url or an object with the following properties\n * @param {string} options.url The url of the resource.\n * @param {object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\n * @param {object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\n * @param {object} [options.headers={}] Additional HTTP headers that will be sent.\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\n * @param {number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\n * @param {string} [options.responseType] The type of response. This controls the type of item returned.\n * @param {string} [options.overrideMimeType] Overrides the MIME type returned by the server.\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n */ $b1dcbeb8d31d71ff$var$Resource.fetch = function(options) {\n const resource = new $b1dcbeb8d31d71ff$var$Resource(options);\n return resource.fetch({\n // Make copy of just the needed fields because headers can be passed to both the constructor and to fetch\n responseType: options.responseType,\n overrideMimeType: options.overrideMimeType\n });\n};\n/**\n * Asynchronously deletes the given resource. Returns a promise that will resolve to\n * the result once loaded, or reject if the resource failed to load. The data is loaded\n * using XMLHttpRequest, which means that in order to make requests to another origin,\n * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.\n *\n * @param {object} [options] Object with the following properties:\n * @param {string} [options.responseType] The type of response. This controls the type of item returned.\n * @param {object} [options.headers] Additional HTTP headers to send with the request, if any.\n * @param {string} [options.overrideMimeType] Overrides the MIME type returned by the server.\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n *\n *\n * @example\n * resource.delete()\n * .then(function(body) {\n * // use the data\n * }).catch(function(error) {\n * // an error occurred\n * });\n *\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\n */ $b1dcbeb8d31d71ff$var$Resource.prototype.delete = function(options) {\n options = $b1dcbeb8d31d71ff$var$defaultClone(options, {});\n options.method = \"DELETE\";\n return this._makeRequest(options);\n};\n/**\n * Creates a Resource from a URL and calls delete() on it.\n *\n * @param {string|object} options A url or an object with the following properties\n * @param {string} options.url The url of the resource.\n * @param {object} [options.data] Data that is posted with the resource.\n * @param {object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\n * @param {object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\n * @param {object} [options.headers={}] Additional HTTP headers that will be sent.\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\n * @param {number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\n * @param {string} [options.responseType] The type of response. This controls the type of item returned.\n * @param {string} [options.overrideMimeType] Overrides the MIME type returned by the server.\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n */ $b1dcbeb8d31d71ff$var$Resource.delete = function(options) {\n const resource = new $b1dcbeb8d31d71ff$var$Resource(options);\n return resource.delete({\n // Make copy of just the needed fields because headers can be passed to both the constructor and to fetch\n responseType: options.responseType,\n overrideMimeType: options.overrideMimeType,\n data: options.data\n });\n};\n/**\n * Asynchronously gets headers the given resource. Returns a promise that will resolve to\n * the result once loaded, or reject if the resource failed to load. The data is loaded\n * using XMLHttpRequest, which means that in order to make requests to another origin,\n * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.\n *\n * @param {object} [options] Object with the following properties:\n * @param {string} [options.responseType] The type of response. This controls the type of item returned.\n * @param {object} [options.headers] Additional HTTP headers to send with the request, if any.\n * @param {string} [options.overrideMimeType] Overrides the MIME type returned by the server.\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n *\n *\n * @example\n * resource.head()\n * .then(function(headers) {\n * // use the data\n * }).catch(function(error) {\n * // an error occurred\n * });\n *\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\n */ $b1dcbeb8d31d71ff$var$Resource.prototype.head = function(options) {\n options = $b1dcbeb8d31d71ff$var$defaultClone(options, {});\n options.method = \"HEAD\";\n return this._makeRequest(options);\n};\n/**\n * Creates a Resource from a URL and calls head() on it.\n *\n * @param {string|object} options A url or an object with the following properties\n * @param {string} options.url The url of the resource.\n * @param {object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\n * @param {object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\n * @param {object} [options.headers={}] Additional HTTP headers that will be sent.\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\n * @param {number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\n * @param {string} [options.responseType] The type of response. This controls the type of item returned.\n * @param {string} [options.overrideMimeType] Overrides the MIME type returned by the server.\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n */ $b1dcbeb8d31d71ff$var$Resource.head = function(options) {\n const resource = new $b1dcbeb8d31d71ff$var$Resource(options);\n return resource.head({\n // Make copy of just the needed fields because headers can be passed to both the constructor and to fetch\n responseType: options.responseType,\n overrideMimeType: options.overrideMimeType\n });\n};\n/**\n * Asynchronously gets options the given resource. Returns a promise that will resolve to\n * the result once loaded, or reject if the resource failed to load. The data is loaded\n * using XMLHttpRequest, which means that in order to make requests to another origin,\n * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.\n *\n * @param {object} [options] Object with the following properties:\n * @param {string} [options.responseType] The type of response. This controls the type of item returned.\n * @param {object} [options.headers] Additional HTTP headers to send with the request, if any.\n * @param {string} [options.overrideMimeType] Overrides the MIME type returned by the server.\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n *\n *\n * @example\n * resource.options()\n * .then(function(headers) {\n * // use the data\n * }).catch(function(error) {\n * // an error occurred\n * });\n *\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\n */ $b1dcbeb8d31d71ff$var$Resource.prototype.options = function(options) {\n options = $b1dcbeb8d31d71ff$var$defaultClone(options, {});\n options.method = \"OPTIONS\";\n return this._makeRequest(options);\n};\n/**\n * Creates a Resource from a URL and calls options() on it.\n *\n * @param {string|object} options A url or an object with the following properties\n * @param {string} options.url The url of the resource.\n * @param {object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\n * @param {object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\n * @param {object} [options.headers={}] Additional HTTP headers that will be sent.\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\n * @param {number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\n * @param {string} [options.responseType] The type of response. This controls the type of item returned.\n * @param {string} [options.overrideMimeType] Overrides the MIME type returned by the server.\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n */ $b1dcbeb8d31d71ff$var$Resource.options = function(options) {\n const resource = new $b1dcbeb8d31d71ff$var$Resource(options);\n return resource.options({\n // Make copy of just the needed fields because headers can be passed to both the constructor and to fetch\n responseType: options.responseType,\n overrideMimeType: options.overrideMimeType\n });\n};\n/**\n * Asynchronously posts data to the given resource. Returns a promise that will resolve to\n * the result once loaded, or reject if the resource failed to load. The data is loaded\n * using XMLHttpRequest, which means that in order to make requests to another origin,\n * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.\n *\n * @param {object} data Data that is posted with the resource.\n * @param {object} [options] Object with the following properties:\n * @param {object} [options.data] Data that is posted with the resource.\n * @param {string} [options.responseType] The type of response. This controls the type of item returned.\n * @param {object} [options.headers] Additional HTTP headers to send with the request, if any.\n * @param {string} [options.overrideMimeType] Overrides the MIME type returned by the server.\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n *\n *\n * @example\n * resource.post(data)\n * .then(function(result) {\n * // use the result\n * }).catch(function(error) {\n * // an error occurred\n * });\n *\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\n */ $b1dcbeb8d31d71ff$var$Resource.prototype.post = function(data, options) {\n (0, $3pzcG.default).defined(\"data\", data);\n options = $b1dcbeb8d31d71ff$var$defaultClone(options, {});\n options.method = \"POST\";\n options.data = data;\n return this._makeRequest(options);\n};\n/**\n * Creates a Resource from a URL and calls post() on it.\n *\n * @param {object} options A url or an object with the following properties\n * @param {string} options.url The url of the resource.\n * @param {object} options.data Data that is posted with the resource.\n * @param {object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\n * @param {object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\n * @param {object} [options.headers={}] Additional HTTP headers that will be sent.\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\n * @param {number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\n * @param {string} [options.responseType] The type of response. This controls the type of item returned.\n * @param {string} [options.overrideMimeType] Overrides the MIME type returned by the server.\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n */ $b1dcbeb8d31d71ff$var$Resource.post = function(options) {\n const resource = new $b1dcbeb8d31d71ff$var$Resource(options);\n return resource.post(options.data, {\n // Make copy of just the needed fields because headers can be passed to both the constructor and to post\n responseType: options.responseType,\n overrideMimeType: options.overrideMimeType\n });\n};\n/**\n * Asynchronously puts data to the given resource. Returns a promise that will resolve to\n * the result once loaded, or reject if the resource failed to load. The data is loaded\n * using XMLHttpRequest, which means that in order to make requests to another origin,\n * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.\n *\n * @param {object} data Data that is posted with the resource.\n * @param {object} [options] Object with the following properties:\n * @param {string} [options.responseType] The type of response. This controls the type of item returned.\n * @param {object} [options.headers] Additional HTTP headers to send with the request, if any.\n * @param {string} [options.overrideMimeType] Overrides the MIME type returned by the server.\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n *\n *\n * @example\n * resource.put(data)\n * .then(function(result) {\n * // use the result\n * }).catch(function(error) {\n * // an error occurred\n * });\n *\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\n */ $b1dcbeb8d31d71ff$var$Resource.prototype.put = function(data, options) {\n (0, $3pzcG.default).defined(\"data\", data);\n options = $b1dcbeb8d31d71ff$var$defaultClone(options, {});\n options.method = \"PUT\";\n options.data = data;\n return this._makeRequest(options);\n};\n/**\n * Creates a Resource from a URL and calls put() on it.\n *\n * @param {object} options A url or an object with the following properties\n * @param {string} options.url The url of the resource.\n * @param {object} options.data Data that is posted with the resource.\n * @param {object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\n * @param {object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\n * @param {object} [options.headers={}] Additional HTTP headers that will be sent.\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\n * @param {number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\n * @param {string} [options.responseType] The type of response. This controls the type of item returned.\n * @param {string} [options.overrideMimeType] Overrides the MIME type returned by the server.\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n */ $b1dcbeb8d31d71ff$var$Resource.put = function(options) {\n const resource = new $b1dcbeb8d31d71ff$var$Resource(options);\n return resource.put(options.data, {\n // Make copy of just the needed fields because headers can be passed to both the constructor and to post\n responseType: options.responseType,\n overrideMimeType: options.overrideMimeType\n });\n};\n/**\n * Asynchronously patches data to the given resource. Returns a promise that will resolve to\n * the result once loaded, or reject if the resource failed to load. The data is loaded\n * using XMLHttpRequest, which means that in order to make requests to another origin,\n * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.\n *\n * @param {object} data Data that is posted with the resource.\n * @param {object} [options] Object with the following properties:\n * @param {string} [options.responseType] The type of response. This controls the type of item returned.\n * @param {object} [options.headers] Additional HTTP headers to send with the request, if any.\n * @param {string} [options.overrideMimeType] Overrides the MIME type returned by the server.\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n *\n *\n * @example\n * resource.patch(data)\n * .then(function(result) {\n * // use the result\n * }).catch(function(error) {\n * // an error occurred\n * });\n *\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\n */ $b1dcbeb8d31d71ff$var$Resource.prototype.patch = function(data, options) {\n (0, $3pzcG.default).defined(\"data\", data);\n options = $b1dcbeb8d31d71ff$var$defaultClone(options, {});\n options.method = \"PATCH\";\n options.data = data;\n return this._makeRequest(options);\n};\n/**\n * Creates a Resource from a URL and calls patch() on it.\n *\n * @param {object} options A url or an object with the following properties\n * @param {string} options.url The url of the resource.\n * @param {object} options.data Data that is posted with the resource.\n * @param {object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\n * @param {object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\n * @param {object} [options.headers={}] Additional HTTP headers that will be sent.\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\n * @param {number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\n * @param {string} [options.responseType] The type of response. This controls the type of item returned.\n * @param {string} [options.overrideMimeType] Overrides the MIME type returned by the server.\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n */ $b1dcbeb8d31d71ff$var$Resource.patch = function(options) {\n const resource = new $b1dcbeb8d31d71ff$var$Resource(options);\n return resource.patch(options.data, {\n // Make copy of just the needed fields because headers can be passed to both the constructor and to post\n responseType: options.responseType,\n overrideMimeType: options.overrideMimeType\n });\n};\n/**\n * Contains implementations of functions that can be replaced for testing\n *\n * @private\n */ $b1dcbeb8d31d71ff$var$Resource._Implementations = {};\n$b1dcbeb8d31d71ff$var$Resource._Implementations.loadImageElement = function(url, crossOrigin, deferred) {\n const image = new Image();\n image.onload = function() {\n // work-around a known issue with Firefox and dimensionless SVG, see:\n // - https://github.com/whatwg/html/issues/3510\n // - https://bugzilla.mozilla.org/show_bug.cgi?id=700533\n if (image.naturalWidth === 0 && image.naturalHeight === 0 && image.width === 0 && image.height === 0) {\n // these values affect rasterization and will likely mar the content\n // until Firefox takes a stance on the issue, marred content is better than no content\n // Chromium uses a more refined heuristic about its choice given nil viewBox, and a better stance and solution is\n // proposed later in the original issue thread:\n // - Chromium behavior: https://github.com/CesiumGS/cesium/issues/9188#issuecomment-704400825\n // - Cesium's stance/solve: https://github.com/CesiumGS/cesium/issues/9188#issuecomment-720645777\n image.width = 300;\n image.height = 150;\n }\n deferred.resolve(image);\n };\n image.onerror = function(e) {\n deferred.reject(e);\n };\n if (crossOrigin) {\n if ((0, $501f833019c34c9b$export$2e2bcd8739ae039).contains(url)) image.crossOrigin = \"use-credentials\";\n else image.crossOrigin = \"\";\n }\n image.src = url;\n};\n$b1dcbeb8d31d71ff$var$Resource._Implementations.createImage = function(request, crossOrigin, deferred, flipY, skipColorSpaceConversion, preferImageBitmap) {\n const url = request.url;\n // Passing an Image to createImageBitmap will force it to run on the main thread\n // since DOM elements don't exist on workers. We convert it to a blob so it's non-blocking.\n // See:\n // https://bugzilla.mozilla.org/show_bug.cgi?id=1044102#c38\n // https://bugs.chromium.org/p/chromium/issues/detail?id=580202#c10\n $b1dcbeb8d31d71ff$var$Resource.supportsImageBitmapOptions().then(function(supportsImageBitmap) {\n // We can only use ImageBitmap if we can flip on decode.\n // See: https://github.com/CesiumGS/cesium/pull/7579#issuecomment-466146898\n if (!(supportsImageBitmap && preferImageBitmap)) {\n $b1dcbeb8d31d71ff$var$Resource._Implementations.loadImageElement(url, crossOrigin, deferred);\n return;\n }\n const responseType = \"blob\";\n const method = \"GET\";\n const xhrDeferred = (0, $6e11a2ab1ac0872e$export$2e2bcd8739ae039)();\n const xhr = $b1dcbeb8d31d71ff$var$Resource._Implementations.loadWithXhr(url, responseType, method, undefined, undefined, xhrDeferred, undefined, undefined, undefined);\n if ((0, $jQJji.default)(xhr) && (0, $jQJji.default)(xhr.abort)) request.cancelFunction = function() {\n xhr.abort();\n };\n return xhrDeferred.promise.then(function(blob) {\n if (!(0, $jQJji.default)(blob)) {\n deferred.reject(new (0, $60086b06bf5db23f$export$2e2bcd8739ae039)(`Successfully retrieved ${url} but it contained no content.`));\n return;\n }\n return $b1dcbeb8d31d71ff$var$Resource.createImageBitmapFromBlob(blob, {\n flipY: flipY,\n premultiplyAlpha: false,\n skipColorSpaceConversion: skipColorSpaceConversion\n });\n }).then(function(image) {\n deferred.resolve(image);\n });\n }).catch(function(e) {\n deferred.reject(e);\n });\n};\n/**\n * Wrapper for createImageBitmap\n *\n * @private\n */ $b1dcbeb8d31d71ff$var$Resource.createImageBitmapFromBlob = function(blob, options) {\n (0, $3pzcG.default).defined(\"options\", options);\n (0, $3pzcG.default).typeOf.bool(\"options.flipY\", options.flipY);\n (0, $3pzcG.default).typeOf.bool(\"options.premultiplyAlpha\", options.premultiplyAlpha);\n (0, $3pzcG.default).typeOf.bool(\"options.skipColorSpaceConversion\", options.skipColorSpaceConversion);\n return createImageBitmap(blob, {\n imageOrientation: options.flipY ? \"flipY\" : \"none\",\n premultiplyAlpha: options.premultiplyAlpha ? \"premultiply\" : \"none\",\n colorSpaceConversion: options.skipColorSpaceConversion ? \"none\" : \"default\"\n });\n};\nfunction $b1dcbeb8d31d71ff$var$loadWithHttpRequest(url, responseType, method, data, headers, deferred, overrideMimeType) {\n // Note: only the 'json' and 'text' responseTypes transforms the loaded buffer\n fetch(url, {\n method: method,\n headers: headers\n }).then(async (response)=>{\n if (!response.ok) {\n const responseHeaders = {};\n response.headers.forEach((value, key)=>{\n responseHeaders[key] = value;\n });\n deferred.reject(new (0, $91769fedd238ef04$export$2e2bcd8739ae039)(response.status, response, responseHeaders));\n return;\n }\n switch(responseType){\n case \"text\":\n deferred.resolve(response.text());\n break;\n case \"json\":\n deferred.resolve(response.json());\n break;\n default:\n deferred.resolve(new Uint8Array(await response.arrayBuffer()).buffer);\n break;\n }\n }).catch(()=>{\n deferred.reject(new (0, $91769fedd238ef04$export$2e2bcd8739ae039)());\n });\n}\nconst $b1dcbeb8d31d71ff$var$noXMLHttpRequest = typeof XMLHttpRequest === \"undefined\";\n$b1dcbeb8d31d71ff$var$Resource._Implementations.loadWithXhr = function(url, responseType, method, data, headers, deferred, overrideMimeType) {\n const dataUriRegexResult = $b1dcbeb8d31d71ff$var$dataUriRegex.exec(url);\n if (dataUriRegexResult !== null) {\n deferred.resolve($b1dcbeb8d31d71ff$var$decodeDataUri(dataUriRegexResult, responseType));\n return;\n }\n if ($b1dcbeb8d31d71ff$var$noXMLHttpRequest) {\n $b1dcbeb8d31d71ff$var$loadWithHttpRequest(url, responseType, method, data, headers, deferred, overrideMimeType);\n return;\n }\n const xhr = new XMLHttpRequest();\n if ((0, $501f833019c34c9b$export$2e2bcd8739ae039).contains(url)) xhr.withCredentials = true;\n xhr.open(method, url, true);\n if ((0, $jQJji.default)(overrideMimeType) && (0, $jQJji.default)(xhr.overrideMimeType)) xhr.overrideMimeType(overrideMimeType);\n if ((0, $jQJji.default)(headers)) {\n for(const key in headers)if (headers.hasOwnProperty(key)) xhr.setRequestHeader(key, headers[key]);\n }\n if ((0, $jQJji.default)(responseType)) xhr.responseType = responseType;\n // While non-standard, file protocol always returns a status of 0 on success\n let localFile = false;\n if (typeof url === \"string\") localFile = url.indexOf(\"file://\") === 0 || typeof window !== \"undefined\" && window.location.origin === \"file://\";\n xhr.onload = function() {\n if ((xhr.status < 200 || xhr.status >= 300) && !(localFile && xhr.status === 0)) {\n deferred.reject(new (0, $91769fedd238ef04$export$2e2bcd8739ae039)(xhr.status, xhr.response, xhr.getAllResponseHeaders()));\n return;\n }\n const response = xhr.response;\n const browserResponseType = xhr.responseType;\n if (method === \"HEAD\" || method === \"OPTIONS\") {\n const responseHeaderString = xhr.getAllResponseHeaders();\n const splitHeaders = responseHeaderString.trim().split(/[\\r\\n]+/);\n const responseHeaders = {};\n splitHeaders.forEach(function(line) {\n const parts = line.split(\": \");\n const header = parts.shift();\n responseHeaders[header] = parts.join(\": \");\n });\n deferred.resolve(responseHeaders);\n return;\n }\n //All modern browsers will go into either the first or second if block or last else block.\n //Other code paths support older browsers that either do not support the supplied responseType\n //or do not support the xhr.response property.\n if (xhr.status === 204) // accept no content\n deferred.resolve(undefined);\n else if ((0, $jQJji.default)(response) && (!(0, $jQJji.default)(responseType) || browserResponseType === responseType)) deferred.resolve(response);\n else if (responseType === \"json\" && typeof response === \"string\") try {\n deferred.resolve(JSON.parse(response));\n } catch (e) {\n deferred.reject(e);\n }\n else if ((browserResponseType === \"\" || browserResponseType === \"document\") && (0, $jQJji.default)(xhr.responseXML) && xhr.responseXML.hasChildNodes()) deferred.resolve(xhr.responseXML);\n else if ((browserResponseType === \"\" || browserResponseType === \"text\") && (0, $jQJji.default)(xhr.responseText)) deferred.resolve(xhr.responseText);\n else deferred.reject(new (0, $60086b06bf5db23f$export$2e2bcd8739ae039)(\"Invalid XMLHttpRequest response type.\"));\n };\n xhr.onerror = function(e) {\n deferred.reject(new (0, $91769fedd238ef04$export$2e2bcd8739ae039)());\n };\n xhr.send(data);\n return xhr;\n};\n$b1dcbeb8d31d71ff$var$Resource._Implementations.loadAndExecuteScript = function(url, functionName, deferred) {\n return (0, $e3fa9c82e19e3667$export$2e2bcd8739ae039)(url, functionName).catch(function(e) {\n deferred.reject(e);\n });\n};\n/**\n * The default implementations\n *\n * @private\n */ $b1dcbeb8d31d71ff$var$Resource._DefaultImplementations = {};\n$b1dcbeb8d31d71ff$var$Resource._DefaultImplementations.createImage = $b1dcbeb8d31d71ff$var$Resource._Implementations.createImage;\n$b1dcbeb8d31d71ff$var$Resource._DefaultImplementations.loadWithXhr = $b1dcbeb8d31d71ff$var$Resource._Implementations.loadWithXhr;\n$b1dcbeb8d31d71ff$var$Resource._DefaultImplementations.loadAndExecuteScript = $b1dcbeb8d31d71ff$var$Resource._Implementations.loadAndExecuteScript;\n/**\n * A resource instance initialized to the current browser location\n *\n * @type {Resource}\n * @constant\n */ $b1dcbeb8d31d71ff$var$Resource.DEFAULT = Object.freeze(new $b1dcbeb8d31d71ff$var$Resource({\n url: typeof document === \"undefined\" ? \"\" : document.location.href.split(\"?\")[0]\n}));\nvar /**\n * A function that returns the value of the property.\n * @callback Resource.RetryCallback\n *\n * @param {Resource} [resource] The resource that failed to load.\n * @param {RequestErrorEvent} [error] The error that occurred during the loading of the resource.\n * @returns {boolean|Promisetrue
if they are equal, false
otherwise.\n *\n * @param {HeadingPitchRoll} [left] The first HeadingPitchRoll.\n * @param {HeadingPitchRoll} [right] The second HeadingPitchRoll.\n * @returns {boolean} true
if left and right are equal, false
otherwise.\n */ $79e069d5452f6556$var$HeadingPitchRoll.equals = function(left, right) {\n return left === right || (0, $jQJji.default)(left) && (0, $jQJji.default)(right) && left.heading === right.heading && left.pitch === right.pitch && left.roll === right.roll;\n};\n/**\n * Compares the provided HeadingPitchRolls componentwise and returns\n * true
if they pass an absolute or relative tolerance test,\n * false
otherwise.\n *\n * @param {HeadingPitchRoll} [left] The first HeadingPitchRoll.\n * @param {HeadingPitchRoll} [right] The second HeadingPitchRoll.\n * @param {number} [relativeEpsilon=0] The relative epsilon tolerance to use for equality testing.\n * @param {number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing.\n * @returns {boolean} true
if left and right are within the provided epsilon, false
otherwise.\n */ $79e069d5452f6556$var$HeadingPitchRoll.equalsEpsilon = function(left, right, relativeEpsilon, absoluteEpsilon) {\n return left === right || (0, $jQJji.default)(left) && (0, $jQJji.default)(right) && (0, $AXvpI.default).equalsEpsilon(left.heading, right.heading, relativeEpsilon, absoluteEpsilon) && (0, $AXvpI.default).equalsEpsilon(left.pitch, right.pitch, relativeEpsilon, absoluteEpsilon) && (0, $AXvpI.default).equalsEpsilon(left.roll, right.roll, relativeEpsilon, absoluteEpsilon);\n};\n/**\n * Duplicates this HeadingPitchRoll instance.\n *\n * @param {HeadingPitchRoll} [result] The object onto which to store the result.\n * @returns {HeadingPitchRoll} The modified result parameter or a new HeadingPitchRoll instance if one was not provided.\n */ $79e069d5452f6556$var$HeadingPitchRoll.prototype.clone = function(result) {\n return $79e069d5452f6556$var$HeadingPitchRoll.clone(this, result);\n};\n/**\n * Compares this HeadingPitchRoll against the provided HeadingPitchRoll componentwise and returns\n * true
if they are equal, false
otherwise.\n *\n * @param {HeadingPitchRoll} [right] The right hand side HeadingPitchRoll.\n * @returns {boolean} true
if they are equal, false
otherwise.\n */ $79e069d5452f6556$var$HeadingPitchRoll.prototype.equals = function(right) {\n return $79e069d5452f6556$var$HeadingPitchRoll.equals(this, right);\n};\n/**\n * Compares this HeadingPitchRoll against the provided HeadingPitchRoll componentwise and returns\n * true
if they pass an absolute or relative tolerance test,\n * false
otherwise.\n *\n * @param {HeadingPitchRoll} [right] The right hand side HeadingPitchRoll.\n * @param {number} [relativeEpsilon=0] The relative epsilon tolerance to use for equality testing.\n * @param {number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing.\n * @returns {boolean} true
if they are within the provided epsilon, false
otherwise.\n */ $79e069d5452f6556$var$HeadingPitchRoll.prototype.equalsEpsilon = function(right, relativeEpsilon, absoluteEpsilon) {\n return $79e069d5452f6556$var$HeadingPitchRoll.equalsEpsilon(this, right, relativeEpsilon, absoluteEpsilon);\n};\n/**\n * Creates a string representing this HeadingPitchRoll in the format '(heading, pitch, roll)' in radians.\n *\n * @returns {string} A string representing the provided HeadingPitchRoll in the format '(heading, pitch, roll)'.\n */ $79e069d5452f6556$var$HeadingPitchRoll.prototype.toString = function() {\n return `(${this.heading}, ${this.pitch}, ${this.roll})`;\n};\nvar $79e069d5452f6556$export$2e2bcd8739ae039 = $79e069d5452f6556$var$HeadingPitchRoll;\n\n\n\nvar $jQJji = parcelRequire(\"jQJji\");\n\nvar $1vHsR = parcelRequire(\"1vHsR\");\n\n\nvar $b73be531cd978718$import_meta = Object.assign(Object.create(null), {\n url: \"file:///node_modules/@cesium/engine/Source/Core/buildModuleUrl.js\"\n});\n/*global CESIUM_BASE_URL,define,require*/ const $b73be531cd978718$var$cesiumScriptRegex = /((?:.*\\/)|^)Cesium\\.js(?:\\?|\\#|$)/;\nfunction $b73be531cd978718$var$getBaseUrlFromCesiumScript() {\n const scripts = document.getElementsByTagName(\"script\");\n for(let i = 0, len = scripts.length; i < len; ++i){\n const src = scripts[i].getAttribute(\"src\");\n const result = $b73be531cd978718$var$cesiumScriptRegex.exec(src);\n if (result !== null) return result[1];\n }\n return undefined;\n}\nlet $b73be531cd978718$var$a;\nfunction $b73be531cd978718$var$tryMakeAbsolute(url) {\n if (typeof document === \"undefined\") // Node.js and Web Workers. In both cases, the URL will already be absolute.\n return url;\n if (!(0, $jQJji.default)($b73be531cd978718$var$a)) $b73be531cd978718$var$a = document.createElement(\"a\");\n $b73be531cd978718$var$a.href = url;\n return $b73be531cd978718$var$a.href;\n}\nlet $b73be531cd978718$var$baseResource;\nfunction $b73be531cd978718$var$getCesiumBaseUrl() {\n if ((0, $jQJji.default)($b73be531cd978718$var$baseResource)) return $b73be531cd978718$var$baseResource;\n let baseUrlString;\n if (typeof CESIUM_BASE_URL !== \"undefined\") baseUrlString = CESIUM_BASE_URL;\n else if ((0, $jQJji.default)($b73be531cd978718$import_meta?.url)) // ESM\n baseUrlString = (0, $5d7f3681ccbe43e2$export$2e2bcd8739ae039)(\".\", \"file:///node_modules/@cesium/engine/Source/Core/buildModuleUrl.js\");\n else if (typeof define === \"object\" && (0, $jQJji.default)(define.amd) && !define.amd.toUrlUndefined && (0, $jQJji.default)(undefined)) // RequireJS\n baseUrlString = (0, $5d7f3681ccbe43e2$export$2e2bcd8739ae039)(\"..\", $b73be531cd978718$var$buildModuleUrl(\"Core/buildModuleUrl.js\"));\n else // IIFE\n baseUrlString = $b73be531cd978718$var$getBaseUrlFromCesiumScript();\n //>>includeStart('debug', pragmas.debug);\n if (!(0, $jQJji.default)(baseUrlString)) throw new (0, $1vHsR.default)(\"Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.\");\n //>>includeEnd('debug');\n $b73be531cd978718$var$baseResource = new (0, $b1dcbeb8d31d71ff$export$2e2bcd8739ae039)({\n url: $b73be531cd978718$var$tryMakeAbsolute(baseUrlString)\n });\n $b73be531cd978718$var$baseResource.appendForwardSlash();\n return $b73be531cd978718$var$baseResource;\n}\nfunction $b73be531cd978718$var$buildModuleUrlFromRequireToUrl(moduleID) {\n //moduleID will be non-relative, so require it relative to this module, in Core.\n return $b73be531cd978718$var$tryMakeAbsolute(undefined(`../${moduleID}`));\n}\nfunction $b73be531cd978718$var$buildModuleUrlFromBaseUrl(moduleID) {\n const resource = $b73be531cd978718$var$getCesiumBaseUrl().getDerivedResource({\n url: moduleID\n });\n return resource.url;\n}\nlet $b73be531cd978718$var$implementation;\n/**\n * Given a relative URL under the Cesium base URL, returns an absolute URL.\n * @function\n *\n * @param {string} relativeUrl The relative path.\n * @returns {string} The absolutely URL representation of the provided path.\n *\n * @example\n * const viewer = new Cesium.Viewer(\"cesiumContainer\", {\n * baseLayer: Cesium.ImageryLayer.fromProviderAsync(\n * Cesium.TileMapServiceImageryProvider.fromUrl(\n * Cesium.buildModuleUrl(\"Assets/Textures/NaturalEarthII\"),\n * )),\n * baseLayerPicker: false,\n * });\n */ function $b73be531cd978718$var$buildModuleUrl(relativeUrl) {\n if (!(0, $jQJji.default)($b73be531cd978718$var$implementation)) {\n //select implementation\n if (typeof define === \"object\" && (0, $jQJji.default)(define.amd) && !define.amd.toUrlUndefined && (0, $jQJji.default)(undefined)) $b73be531cd978718$var$implementation = $b73be531cd978718$var$buildModuleUrlFromRequireToUrl;\n else $b73be531cd978718$var$implementation = $b73be531cd978718$var$buildModuleUrlFromBaseUrl;\n }\n const url = $b73be531cd978718$var$implementation(relativeUrl);\n return url;\n}\n// exposed for testing\n$b73be531cd978718$var$buildModuleUrl._cesiumScriptRegex = $b73be531cd978718$var$cesiumScriptRegex;\n$b73be531cd978718$var$buildModuleUrl._buildModuleUrlFromBaseUrl = $b73be531cd978718$var$buildModuleUrlFromBaseUrl;\n$b73be531cd978718$var$buildModuleUrl._clearBaseResource = function() {\n $b73be531cd978718$var$baseResource = undefined;\n};\n/**\n * Sets the base URL for resolving modules.\n * @param {string} value The new base URL.\n */ $b73be531cd978718$var$buildModuleUrl.setBaseUrl = function(value) {\n $b73be531cd978718$var$baseResource = (0, $b1dcbeb8d31d71ff$export$2e2bcd8739ae039).DEFAULT.getDerivedResource({\n url: value\n });\n};\n/**\n * Gets the base URL for resolving modules.\n *\n * @function\n * @returns {string} The configured base URL\n */ $b73be531cd978718$var$buildModuleUrl.getCesiumBaseUrl = $b73be531cd978718$var$getCesiumBaseUrl;\nvar $b73be531cd978718$export$2e2bcd8739ae039 = $b73be531cd978718$var$buildModuleUrl;\n\n\n\nvar $8w8ZH = parcelRequire(\"8w8ZH\");\n\nvar $jQJji = parcelRequire(\"jQJji\");\n/**\n * An IAU 2006 XYS value sampled at a particular time.\n *\n * @alias Iau2006XysSample\n * @constructor\n *\n * @param {number} x The X value.\n * @param {number} y The Y value.\n * @param {number} s The S value.\n *\n * @private\n */ function $c9c1200a42974c2d$var$Iau2006XysSample(x, y, s) {\n /**\n * The X value.\n * @type {number}\n */ this.x = x;\n /**\n * The Y value.\n * @type {number}\n */ this.y = y;\n /**\n * The S value.\n * @type {number}\n */ this.s = s;\n}\nvar $c9c1200a42974c2d$export$2e2bcd8739ae039 = $c9c1200a42974c2d$var$Iau2006XysSample;\n\n\n\n\n\n/**\n * A set of IAU2006 XYS data that is used to evaluate the transformation between the International\n * Celestial Reference Frame (ICRF) and the International Terrestrial Reference Frame (ITRF).\n *\n * @alias Iau2006XysData\n * @constructor\n *\n * @param {object} [options] Object with the following properties:\n * @param {Resource|string} [options.xysFileUrlTemplate='Assets/IAU2006_XYS/IAU2006_XYS_{0}.json'] A template URL for obtaining the XYS data. In the template,\n * `{0}` will be replaced with the file index.\n * @param {number} [options.interpolationOrder=9] The order of interpolation to perform on the XYS data.\n * @param {number} [options.sampleZeroJulianEphemerisDate=2442396.5] The Julian ephemeris date (JED) of the\n * first XYS sample.\n * @param {number} [options.stepSizeDays=1.0] The step size, in days, between successive XYS samples.\n * @param {number} [options.samplesPerXysFile=1000] The number of samples in each XYS file.\n * @param {number} [options.totalSamples=27426] The total number of samples in all XYS files.\n *\n * @private\n */ function $7212c54286490aec$var$Iau2006XysData(options) {\n options = (0, $8w8ZH.default)(options, (0, $8w8ZH.default).EMPTY_OBJECT);\n this._xysFileUrlTemplate = (0, $b1dcbeb8d31d71ff$export$2e2bcd8739ae039).createIfNeeded(options.xysFileUrlTemplate);\n this._interpolationOrder = (0, $8w8ZH.default)(options.interpolationOrder, 9);\n this._sampleZeroJulianEphemerisDate = (0, $8w8ZH.default)(options.sampleZeroJulianEphemerisDate, 2442396.5);\n this._sampleZeroDateTT = new (0, $73b9691e04761700$export$2e2bcd8739ae039)(this._sampleZeroJulianEphemerisDate, 0.0, (0, $134462e760c5c083$export$2e2bcd8739ae039).TAI);\n this._stepSizeDays = (0, $8w8ZH.default)(options.stepSizeDays, 1.0);\n this._samplesPerXysFile = (0, $8w8ZH.default)(options.samplesPerXysFile, 1000);\n this._totalSamples = (0, $8w8ZH.default)(options.totalSamples, 27426);\n this._samples = new Array(this._totalSamples * 3);\n this._chunkDownloadsInProgress = [];\n const order = this._interpolationOrder;\n // Compute denominators and X values for interpolation.\n const denom = this._denominators = new Array(order + 1);\n const xTable = this._xTable = new Array(order + 1);\n const stepN = Math.pow(this._stepSizeDays, order);\n for(let i = 0; i <= order; ++i){\n denom[i] = stepN;\n xTable[i] = i * this._stepSizeDays;\n for(let j = 0; j <= order; ++j)if (j !== i) denom[i] *= i - j;\n denom[i] = 1.0 / denom[i];\n }\n // Allocate scratch arrays for interpolation.\n this._work = new Array(order + 1);\n this._coef = new Array(order + 1);\n}\nconst $7212c54286490aec$var$julianDateScratch = new (0, $73b9691e04761700$export$2e2bcd8739ae039)(0, 0.0, (0, $134462e760c5c083$export$2e2bcd8739ae039).TAI);\nfunction $7212c54286490aec$var$getDaysSinceEpoch(xys, dayTT, secondTT) {\n const dateTT = $7212c54286490aec$var$julianDateScratch;\n dateTT.dayNumber = dayTT;\n dateTT.secondsOfDay = secondTT;\n return (0, $73b9691e04761700$export$2e2bcd8739ae039).daysDifference(dateTT, xys._sampleZeroDateTT);\n}\n/**\n * Preloads XYS data for a specified date range.\n *\n * @param {number} startDayTT The Julian day number of the beginning of the interval to preload, expressed in\n * the Terrestrial Time (TT) time standard.\n * @param {number} startSecondTT The seconds past noon of the beginning of the interval to preload, expressed in\n * the Terrestrial Time (TT) time standard.\n * @param {number} stopDayTT The Julian day number of the end of the interval to preload, expressed in\n * the Terrestrial Time (TT) time standard.\n * @param {number} stopSecondTT The seconds past noon of the end of the interval to preload, expressed in\n * the Terrestrial Time (TT) time standard.\n * @returns {Promisetrue
if the browser supports the standard fullscreen API,\n * false
otherwise.\n */ $19a47bf34378ad7c$var$Fullscreen.supportsFullscreen = function() {\n if ((0, $jQJji.default)($19a47bf34378ad7c$var$_supportsFullscreen)) return $19a47bf34378ad7c$var$_supportsFullscreen;\n $19a47bf34378ad7c$var$_supportsFullscreen = false;\n const body = document.body;\n if (typeof body.requestFullscreen === \"function\") {\n // go with the unprefixed, standard set of names\n $19a47bf34378ad7c$var$_names.requestFullscreen = \"requestFullscreen\";\n $19a47bf34378ad7c$var$_names.exitFullscreen = \"exitFullscreen\";\n $19a47bf34378ad7c$var$_names.fullscreenEnabled = \"fullscreenEnabled\";\n $19a47bf34378ad7c$var$_names.fullscreenElement = \"fullscreenElement\";\n $19a47bf34378ad7c$var$_names.fullscreenchange = \"fullscreenchange\";\n $19a47bf34378ad7c$var$_names.fullscreenerror = \"fullscreenerror\";\n $19a47bf34378ad7c$var$_supportsFullscreen = true;\n return $19a47bf34378ad7c$var$_supportsFullscreen;\n }\n //check for the correct combination of prefix plus the various names that browsers use\n const prefixes = [\n \"webkit\",\n \"moz\",\n \"o\",\n \"ms\",\n \"khtml\"\n ];\n let name;\n for(let i = 0, len = prefixes.length; i < len; ++i){\n const prefix = prefixes[i];\n // casing of Fullscreen differs across browsers\n name = `${prefix}RequestFullscreen`;\n if (typeof body[name] === \"function\") {\n $19a47bf34378ad7c$var$_names.requestFullscreen = name;\n $19a47bf34378ad7c$var$_supportsFullscreen = true;\n } else {\n name = `${prefix}RequestFullScreen`;\n if (typeof body[name] === \"function\") {\n $19a47bf34378ad7c$var$_names.requestFullscreen = name;\n $19a47bf34378ad7c$var$_supportsFullscreen = true;\n }\n }\n // disagreement about whether it's \"exit\" as per spec, or \"cancel\"\n name = `${prefix}ExitFullscreen`;\n if (typeof document[name] === \"function\") $19a47bf34378ad7c$var$_names.exitFullscreen = name;\n else {\n name = `${prefix}CancelFullScreen`;\n if (typeof document[name] === \"function\") $19a47bf34378ad7c$var$_names.exitFullscreen = name;\n }\n // casing of Fullscreen differs across browsers\n name = `${prefix}FullscreenEnabled`;\n if (document[name] !== undefined) $19a47bf34378ad7c$var$_names.fullscreenEnabled = name;\n else {\n name = `${prefix}FullScreenEnabled`;\n if (document[name] !== undefined) $19a47bf34378ad7c$var$_names.fullscreenEnabled = name;\n }\n // casing of Fullscreen differs across browsers\n name = `${prefix}FullscreenElement`;\n if (document[name] !== undefined) $19a47bf34378ad7c$var$_names.fullscreenElement = name;\n else {\n name = `${prefix}FullScreenElement`;\n if (document[name] !== undefined) $19a47bf34378ad7c$var$_names.fullscreenElement = name;\n }\n // thankfully, event names are all lowercase per spec\n name = `${prefix}fullscreenchange`;\n // event names do not have 'on' in the front, but the property on the document does\n if (document[`on${name}`] !== undefined) {\n //except on IE\n if (prefix === \"ms\") name = \"MSFullscreenChange\";\n $19a47bf34378ad7c$var$_names.fullscreenchange = name;\n }\n name = `${prefix}fullscreenerror`;\n if (document[`on${name}`] !== undefined) {\n //except on IE\n if (prefix === \"ms\") name = \"MSFullscreenError\";\n $19a47bf34378ad7c$var$_names.fullscreenerror = name;\n }\n }\n return $19a47bf34378ad7c$var$_supportsFullscreen;\n};\n/**\n * Asynchronously requests the browser to enter fullscreen mode on the given element.\n * If fullscreen mode is not supported by the browser, does nothing.\n *\n * @param {object} element The HTML element which will be placed into fullscreen mode.\n * @param {object} [vrDevice] The HMDVRDevice device.\n *\n * @example\n * // Put the entire page into fullscreen.\n * Cesium.Fullscreen.requestFullscreen(document.body)\n *\n * // Place only the Cesium canvas into fullscreen.\n * Cesium.Fullscreen.requestFullscreen(scene.canvas)\n */ $19a47bf34378ad7c$var$Fullscreen.requestFullscreen = function(element, vrDevice) {\n if (!$19a47bf34378ad7c$var$Fullscreen.supportsFullscreen()) return;\n element[$19a47bf34378ad7c$var$_names.requestFullscreen]({\n vrDisplay: vrDevice\n });\n};\n/**\n * Asynchronously exits fullscreen mode. If the browser is not currently\n * in fullscreen, or if fullscreen mode is not supported by the browser, does nothing.\n */ $19a47bf34378ad7c$var$Fullscreen.exitFullscreen = function() {\n if (!$19a47bf34378ad7c$var$Fullscreen.supportsFullscreen()) return;\n document[$19a47bf34378ad7c$var$_names.exitFullscreen]();\n};\n//For unit tests\n$19a47bf34378ad7c$var$Fullscreen._names = $19a47bf34378ad7c$var$_names;\nvar $19a47bf34378ad7c$export$2e2bcd8739ae039 = $19a47bf34378ad7c$var$Fullscreen;\n\n\nlet $da149e13e9eaa5f6$var$theNavigator;\nif (typeof navigator !== \"undefined\") $da149e13e9eaa5f6$var$theNavigator = navigator;\nelse $da149e13e9eaa5f6$var$theNavigator = {};\nfunction $da149e13e9eaa5f6$var$extractVersion(versionString) {\n const parts = versionString.split(\".\");\n for(let i = 0, len = parts.length; i < len; ++i)parts[i] = parseInt(parts[i], 10);\n return parts;\n}\nlet $da149e13e9eaa5f6$var$isChromeResult;\nlet $da149e13e9eaa5f6$var$chromeVersionResult;\nfunction $da149e13e9eaa5f6$var$isChrome() {\n if (!(0, $jQJji.default)($da149e13e9eaa5f6$var$isChromeResult)) {\n $da149e13e9eaa5f6$var$isChromeResult = false;\n // Edge contains Chrome in the user agent too\n if (!$da149e13e9eaa5f6$var$isEdge()) {\n const fields = / Chrome\\/([\\.0-9]+)/.exec($da149e13e9eaa5f6$var$theNavigator.userAgent);\n if (fields !== null) {\n $da149e13e9eaa5f6$var$isChromeResult = true;\n $da149e13e9eaa5f6$var$chromeVersionResult = $da149e13e9eaa5f6$var$extractVersion(fields[1]);\n }\n }\n }\n return $da149e13e9eaa5f6$var$isChromeResult;\n}\nfunction $da149e13e9eaa5f6$var$chromeVersion() {\n return $da149e13e9eaa5f6$var$isChrome() && $da149e13e9eaa5f6$var$chromeVersionResult;\n}\nlet $da149e13e9eaa5f6$var$isSafariResult;\nlet $da149e13e9eaa5f6$var$safariVersionResult;\nfunction $da149e13e9eaa5f6$var$isSafari() {\n if (!(0, $jQJji.default)($da149e13e9eaa5f6$var$isSafariResult)) {\n $da149e13e9eaa5f6$var$isSafariResult = false;\n // Chrome and Edge contain Safari in the user agent too\n if (!$da149e13e9eaa5f6$var$isChrome() && !$da149e13e9eaa5f6$var$isEdge() && / Safari\\/[\\.0-9]+/.test($da149e13e9eaa5f6$var$theNavigator.userAgent)) {\n const fields = / Version\\/([\\.0-9]+)/.exec($da149e13e9eaa5f6$var$theNavigator.userAgent);\n if (fields !== null) {\n $da149e13e9eaa5f6$var$isSafariResult = true;\n $da149e13e9eaa5f6$var$safariVersionResult = $da149e13e9eaa5f6$var$extractVersion(fields[1]);\n }\n }\n }\n return $da149e13e9eaa5f6$var$isSafariResult;\n}\nfunction $da149e13e9eaa5f6$var$safariVersion() {\n return $da149e13e9eaa5f6$var$isSafari() && $da149e13e9eaa5f6$var$safariVersionResult;\n}\nlet $da149e13e9eaa5f6$var$isWebkitResult;\nlet $da149e13e9eaa5f6$var$webkitVersionResult;\nfunction $da149e13e9eaa5f6$var$isWebkit() {\n if (!(0, $jQJji.default)($da149e13e9eaa5f6$var$isWebkitResult)) {\n $da149e13e9eaa5f6$var$isWebkitResult = false;\n const fields = / AppleWebKit\\/([\\.0-9]+)(\\+?)/.exec($da149e13e9eaa5f6$var$theNavigator.userAgent);\n if (fields !== null) {\n $da149e13e9eaa5f6$var$isWebkitResult = true;\n $da149e13e9eaa5f6$var$webkitVersionResult = $da149e13e9eaa5f6$var$extractVersion(fields[1]);\n $da149e13e9eaa5f6$var$webkitVersionResult.isNightly = !!fields[2];\n }\n }\n return $da149e13e9eaa5f6$var$isWebkitResult;\n}\nfunction $da149e13e9eaa5f6$var$webkitVersion() {\n return $da149e13e9eaa5f6$var$isWebkit() && $da149e13e9eaa5f6$var$webkitVersionResult;\n}\nlet $da149e13e9eaa5f6$var$isInternetExplorerResult;\nlet $da149e13e9eaa5f6$var$internetExplorerVersionResult;\nfunction $da149e13e9eaa5f6$var$isInternetExplorer() {\n if (!(0, $jQJji.default)($da149e13e9eaa5f6$var$isInternetExplorerResult)) {\n $da149e13e9eaa5f6$var$isInternetExplorerResult = false;\n let fields;\n if ($da149e13e9eaa5f6$var$theNavigator.appName === \"Microsoft Internet Explorer\") {\n fields = /MSIE ([0-9]{1,}[\\.0-9]{0,})/.exec($da149e13e9eaa5f6$var$theNavigator.userAgent);\n if (fields !== null) {\n $da149e13e9eaa5f6$var$isInternetExplorerResult = true;\n $da149e13e9eaa5f6$var$internetExplorerVersionResult = $da149e13e9eaa5f6$var$extractVersion(fields[1]);\n }\n } else if ($da149e13e9eaa5f6$var$theNavigator.appName === \"Netscape\") {\n fields = /Trident\\/.*rv:([0-9]{1,}[\\.0-9]{0,})/.exec($da149e13e9eaa5f6$var$theNavigator.userAgent);\n if (fields !== null) {\n $da149e13e9eaa5f6$var$isInternetExplorerResult = true;\n $da149e13e9eaa5f6$var$internetExplorerVersionResult = $da149e13e9eaa5f6$var$extractVersion(fields[1]);\n }\n }\n }\n return $da149e13e9eaa5f6$var$isInternetExplorerResult;\n}\nfunction $da149e13e9eaa5f6$var$internetExplorerVersion() {\n return $da149e13e9eaa5f6$var$isInternetExplorer() && $da149e13e9eaa5f6$var$internetExplorerVersionResult;\n}\nlet $da149e13e9eaa5f6$var$isEdgeResult;\nlet $da149e13e9eaa5f6$var$edgeVersionResult;\nfunction $da149e13e9eaa5f6$var$isEdge() {\n if (!(0, $jQJji.default)($da149e13e9eaa5f6$var$isEdgeResult)) {\n $da149e13e9eaa5f6$var$isEdgeResult = false;\n const fields = / Edg\\/([\\.0-9]+)/.exec($da149e13e9eaa5f6$var$theNavigator.userAgent);\n if (fields !== null) {\n $da149e13e9eaa5f6$var$isEdgeResult = true;\n $da149e13e9eaa5f6$var$edgeVersionResult = $da149e13e9eaa5f6$var$extractVersion(fields[1]);\n }\n }\n return $da149e13e9eaa5f6$var$isEdgeResult;\n}\nfunction $da149e13e9eaa5f6$var$edgeVersion() {\n return $da149e13e9eaa5f6$var$isEdge() && $da149e13e9eaa5f6$var$edgeVersionResult;\n}\nlet $da149e13e9eaa5f6$var$isFirefoxResult;\nlet $da149e13e9eaa5f6$var$firefoxVersionResult;\nfunction $da149e13e9eaa5f6$var$isFirefox() {\n if (!(0, $jQJji.default)($da149e13e9eaa5f6$var$isFirefoxResult)) {\n $da149e13e9eaa5f6$var$isFirefoxResult = false;\n const fields = /Firefox\\/([\\.0-9]+)/.exec($da149e13e9eaa5f6$var$theNavigator.userAgent);\n if (fields !== null) {\n $da149e13e9eaa5f6$var$isFirefoxResult = true;\n $da149e13e9eaa5f6$var$firefoxVersionResult = $da149e13e9eaa5f6$var$extractVersion(fields[1]);\n }\n }\n return $da149e13e9eaa5f6$var$isFirefoxResult;\n}\nlet $da149e13e9eaa5f6$var$isWindowsResult;\nfunction $da149e13e9eaa5f6$var$isWindows() {\n if (!(0, $jQJji.default)($da149e13e9eaa5f6$var$isWindowsResult)) $da149e13e9eaa5f6$var$isWindowsResult = /Windows/i.test($da149e13e9eaa5f6$var$theNavigator.appVersion);\n return $da149e13e9eaa5f6$var$isWindowsResult;\n}\nlet $da149e13e9eaa5f6$var$isIPadOrIOSResult;\nfunction $da149e13e9eaa5f6$var$isIPadOrIOS() {\n if (!(0, $jQJji.default)($da149e13e9eaa5f6$var$isIPadOrIOSResult)) $da149e13e9eaa5f6$var$isIPadOrIOSResult = navigator.platform === \"iPhone\" || navigator.platform === \"iPod\" || navigator.platform === \"iPad\";\n return $da149e13e9eaa5f6$var$isIPadOrIOSResult;\n}\nfunction $da149e13e9eaa5f6$var$firefoxVersion() {\n return $da149e13e9eaa5f6$var$isFirefox() && $da149e13e9eaa5f6$var$firefoxVersionResult;\n}\nlet $da149e13e9eaa5f6$var$hasPointerEvents;\nfunction $da149e13e9eaa5f6$var$supportsPointerEvents() {\n if (!(0, $jQJji.default)($da149e13e9eaa5f6$var$hasPointerEvents)) //While navigator.pointerEnabled is deprecated in the W3C specification\n //we still need to use it if it exists in order to support browsers\n //that rely on it, such as the Windows WebBrowser control which defines\n //PointerEvent but sets navigator.pointerEnabled to false.\n //Firefox disabled because of https://github.com/CesiumGS/cesium/issues/6372\n $da149e13e9eaa5f6$var$hasPointerEvents = !$da149e13e9eaa5f6$var$isFirefox() && typeof PointerEvent !== \"undefined\" && (!(0, $jQJji.default)($da149e13e9eaa5f6$var$theNavigator.pointerEnabled) || $da149e13e9eaa5f6$var$theNavigator.pointerEnabled);\n return $da149e13e9eaa5f6$var$hasPointerEvents;\n}\nlet $da149e13e9eaa5f6$var$imageRenderingValueResult;\nlet $da149e13e9eaa5f6$var$supportsImageRenderingPixelatedResult;\nfunction $da149e13e9eaa5f6$var$supportsImageRenderingPixelated() {\n if (!(0, $jQJji.default)($da149e13e9eaa5f6$var$supportsImageRenderingPixelatedResult)) {\n const canvas = document.createElement(\"canvas\");\n canvas.setAttribute(\"style\", \"image-rendering: -moz-crisp-edges;image-rendering: pixelated;\");\n //canvas.style.imageRendering will be undefined, null or an empty string on unsupported browsers.\n const tmp = canvas.style.imageRendering;\n $da149e13e9eaa5f6$var$supportsImageRenderingPixelatedResult = (0, $jQJji.default)(tmp) && tmp !== \"\";\n if ($da149e13e9eaa5f6$var$supportsImageRenderingPixelatedResult) $da149e13e9eaa5f6$var$imageRenderingValueResult = tmp;\n }\n return $da149e13e9eaa5f6$var$supportsImageRenderingPixelatedResult;\n}\nfunction $da149e13e9eaa5f6$var$imageRenderingValue() {\n return $da149e13e9eaa5f6$var$supportsImageRenderingPixelated() ? $da149e13e9eaa5f6$var$imageRenderingValueResult : undefined;\n}\nfunction $da149e13e9eaa5f6$var$supportsWebP() {\n //>>includeStart('debug', pragmas.debug);\n if (!$da149e13e9eaa5f6$var$supportsWebP.initialized) throw new (0, $1vHsR.default)(\"You must call FeatureDetection.supportsWebP.initialize and wait for the promise to resolve before calling FeatureDetection.supportsWebP\");\n //>>includeEnd('debug');\n return $da149e13e9eaa5f6$var$supportsWebP._result;\n}\n$da149e13e9eaa5f6$var$supportsWebP._promise = undefined;\n$da149e13e9eaa5f6$var$supportsWebP._result = undefined;\n$da149e13e9eaa5f6$var$supportsWebP.initialize = function() {\n // From https://developers.google.com/speed/webp/faq#how_can_i_detect_browser_support_for_webp\n if ((0, $jQJji.default)($da149e13e9eaa5f6$var$supportsWebP._promise)) return $da149e13e9eaa5f6$var$supportsWebP._promise;\n $da149e13e9eaa5f6$var$supportsWebP._promise = new Promise((resolve)=>{\n const image = new Image();\n image.onload = function() {\n $da149e13e9eaa5f6$var$supportsWebP._result = image.width > 0 && image.height > 0;\n resolve($da149e13e9eaa5f6$var$supportsWebP._result);\n };\n image.onerror = function() {\n $da149e13e9eaa5f6$var$supportsWebP._result = false;\n resolve($da149e13e9eaa5f6$var$supportsWebP._result);\n };\n image.src = \"data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA\";\n });\n return $da149e13e9eaa5f6$var$supportsWebP._promise;\n};\nObject.defineProperties($da149e13e9eaa5f6$var$supportsWebP, {\n initialized: {\n get: function() {\n return (0, $jQJji.default)($da149e13e9eaa5f6$var$supportsWebP._result);\n }\n }\n});\nconst $da149e13e9eaa5f6$var$typedArrayTypes = [];\nif (typeof ArrayBuffer !== \"undefined\") {\n $da149e13e9eaa5f6$var$typedArrayTypes.push(Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array);\n if (typeof Uint8ClampedArray !== \"undefined\") $da149e13e9eaa5f6$var$typedArrayTypes.push(Uint8ClampedArray);\n if (typeof Uint8ClampedArray !== \"undefined\") $da149e13e9eaa5f6$var$typedArrayTypes.push(Uint8ClampedArray);\n if (typeof BigInt64Array !== \"undefined\") // eslint-disable-next-line no-undef\n $da149e13e9eaa5f6$var$typedArrayTypes.push(BigInt64Array);\n if (typeof BigUint64Array !== \"undefined\") // eslint-disable-next-line no-undef\n $da149e13e9eaa5f6$var$typedArrayTypes.push(BigUint64Array);\n}\n/**\n * A set of functions to detect whether the current browser supports\n * various features.\n *\n * @namespace FeatureDetection\n */ const $da149e13e9eaa5f6$var$FeatureDetection = {\n isChrome: $da149e13e9eaa5f6$var$isChrome,\n chromeVersion: $da149e13e9eaa5f6$var$chromeVersion,\n isSafari: $da149e13e9eaa5f6$var$isSafari,\n safariVersion: $da149e13e9eaa5f6$var$safariVersion,\n isWebkit: $da149e13e9eaa5f6$var$isWebkit,\n webkitVersion: $da149e13e9eaa5f6$var$webkitVersion,\n isInternetExplorer: $da149e13e9eaa5f6$var$isInternetExplorer,\n internetExplorerVersion: $da149e13e9eaa5f6$var$internetExplorerVersion,\n isEdge: $da149e13e9eaa5f6$var$isEdge,\n edgeVersion: $da149e13e9eaa5f6$var$edgeVersion,\n isFirefox: $da149e13e9eaa5f6$var$isFirefox,\n firefoxVersion: $da149e13e9eaa5f6$var$firefoxVersion,\n isWindows: $da149e13e9eaa5f6$var$isWindows,\n isIPadOrIOS: $da149e13e9eaa5f6$var$isIPadOrIOS,\n hardwareConcurrency: (0, $8w8ZH.default)($da149e13e9eaa5f6$var$theNavigator.hardwareConcurrency, 3),\n supportsPointerEvents: $da149e13e9eaa5f6$var$supportsPointerEvents,\n supportsImageRenderingPixelated: $da149e13e9eaa5f6$var$supportsImageRenderingPixelated,\n supportsWebP: $da149e13e9eaa5f6$var$supportsWebP,\n imageRenderingValue: $da149e13e9eaa5f6$var$imageRenderingValue,\n typedArrayTypes: $da149e13e9eaa5f6$var$typedArrayTypes\n};\n/**\n * Detects whether the current browser supports Basis Universal textures and the web assembly modules needed to transcode them.\n *\n * @param {Scene} scene\n * @returns {boolean} true if the browser supports web assembly modules and the scene supports Basis Universal textures, false if not.\n */ $da149e13e9eaa5f6$var$FeatureDetection.supportsBasis = function(scene) {\n return $da149e13e9eaa5f6$var$FeatureDetection.supportsWebAssembly() && scene.context.supportsBasis;\n};\n/**\n * Detects whether the current browser supports the full screen standard.\n *\n * @returns {boolean} true if the browser supports the full screen standard, false if not.\n *\n * @see Fullscreen\n * @see {@link http://dvcs.w3.org/hg/fullscreen/raw-file/tip/Overview.html|W3C Fullscreen Living Specification}\n */ $da149e13e9eaa5f6$var$FeatureDetection.supportsFullscreen = function() {\n return (0, $19a47bf34378ad7c$export$2e2bcd8739ae039).supportsFullscreen();\n};\n/**\n * Detects whether the current browser supports typed arrays.\n *\n * @returns {boolean} true if the browser supports typed arrays, false if not.\n *\n * @see {@link https://tc39.es/ecma262/#sec-typedarray-objects|Typed Array Specification}\n */ $da149e13e9eaa5f6$var$FeatureDetection.supportsTypedArrays = function() {\n return typeof ArrayBuffer !== \"undefined\";\n};\n/**\n * Detects whether the current browser supports BigInt64Array typed arrays.\n *\n * @returns {boolean} true if the browser supports BigInt64Array typed arrays, false if not.\n *\n * @see {@link https://tc39.es/ecma262/#sec-typedarray-objects|Typed Array Specification}\n */ $da149e13e9eaa5f6$var$FeatureDetection.supportsBigInt64Array = function() {\n return typeof BigInt64Array !== \"undefined\";\n};\n/**\n * Detects whether the current browser supports BigUint64Array typed arrays.\n *\n * @returns {boolean} true if the browser supports BigUint64Array typed arrays, false if not.\n *\n * @see {@link https://tc39.es/ecma262/#sec-typedarray-objects|Typed Array Specification}\n */ $da149e13e9eaa5f6$var$FeatureDetection.supportsBigUint64Array = function() {\n return typeof BigUint64Array !== \"undefined\";\n};\n/**\n * Detects whether the current browser supports BigInt.\n *\n * @returns {boolean} true if the browser supports BigInt, false if not.\n *\n * @see {@link https://tc39.es/ecma262/#sec-bigint-objects|BigInt Specification}\n */ $da149e13e9eaa5f6$var$FeatureDetection.supportsBigInt = function() {\n return typeof BigInt !== \"undefined\";\n};\n/**\n * Detects whether the current browser supports Web Workers.\n *\n * @returns {boolean} true if the browsers supports Web Workers, false if not.\n *\n * @see {@link http://www.w3.org/TR/workers/}\n */ $da149e13e9eaa5f6$var$FeatureDetection.supportsWebWorkers = function() {\n return typeof Worker !== \"undefined\";\n};\n/**\n * Detects whether the current browser supports Web Assembly.\n *\n * @returns {boolean} true if the browsers supports Web Assembly, false if not.\n *\n * @see {@link https://developer.mozilla.org/en-US/docs/WebAssembly}\n */ $da149e13e9eaa5f6$var$FeatureDetection.supportsWebAssembly = function() {\n return typeof WebAssembly !== \"undefined\";\n};\n/**\n * Detects whether the current browser supports a WebGL2 rendering context for the specified scene.\n *\n * @param {Scene} scene the Cesium scene specifying the rendering context\n * @returns {boolean} true if the browser supports a WebGL2 rendering context, false if not.\n *\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext|WebGL2RenderingContext}\n */ $da149e13e9eaa5f6$var$FeatureDetection.supportsWebgl2 = function(scene) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).defined(\"scene\", scene);\n //>>includeEnd('debug');\n return scene.context.webgl2;\n};\n/**\n * Detects whether the current browser supports ECMAScript modules in web workers.\n * @returns {boolean} true if the browser supports ECMAScript modules in web workers.\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Worker|Worker}\n */ $da149e13e9eaa5f6$var$FeatureDetection.supportsEsmWebWorkers = function() {\n return !$da149e13e9eaa5f6$var$isFirefox() || parseInt($da149e13e9eaa5f6$var$firefoxVersionResult) >= 114;\n};\nvar $da149e13e9eaa5f6$export$2e2bcd8739ae039 = $da149e13e9eaa5f6$var$FeatureDetection;\n\n\n\nvar $AXvpI = parcelRequire(\"AXvpI\");\n\n/**\n * A set of 4-dimensional coordinates used to represent rotation in 3-dimensional space.\n * @alias Quaternion\n * @constructor\n *\n * @param {number} [x=0.0] The X component.\n * @param {number} [y=0.0] The Y component.\n * @param {number} [z=0.0] The Z component.\n * @param {number} [w=0.0] The W component.\n *\n * @see PackableForInterpolation\n */ function $cd53d4b312c9644c$var$Quaternion(x, y, z, w) {\n /**\n * The X component.\n * @type {number}\n * @default 0.0\n */ this.x = (0, $8w8ZH.default)(x, 0.0);\n /**\n * The Y component.\n * @type {number}\n * @default 0.0\n */ this.y = (0, $8w8ZH.default)(y, 0.0);\n /**\n * The Z component.\n * @type {number}\n * @default 0.0\n */ this.z = (0, $8w8ZH.default)(z, 0.0);\n /**\n * The W component.\n * @type {number}\n * @default 0.0\n */ this.w = (0, $8w8ZH.default)(w, 0.0);\n}\nlet $cd53d4b312c9644c$var$fromAxisAngleScratch = new (0, $bXwZF.default)();\n/**\n * Computes a quaternion representing a rotation around an axis.\n *\n * @param {Cartesian3} axis The axis of rotation.\n * @param {number} angle The angle in radians to rotate around the axis.\n * @param {Quaternion} [result] The object onto which to store the result.\n * @returns {Quaternion} The modified result parameter or a new Quaternion instance if one was not provided.\n */ $cd53d4b312c9644c$var$Quaternion.fromAxisAngle = function(axis, angle, result) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.object(\"axis\", axis);\n (0, $3pzcG.default).typeOf.number(\"angle\", angle);\n //>>includeEnd('debug');\n const halfAngle = angle / 2.0;\n const s = Math.sin(halfAngle);\n $cd53d4b312c9644c$var$fromAxisAngleScratch = (0, $bXwZF.default).normalize(axis, $cd53d4b312c9644c$var$fromAxisAngleScratch);\n const x = $cd53d4b312c9644c$var$fromAxisAngleScratch.x * s;\n const y = $cd53d4b312c9644c$var$fromAxisAngleScratch.y * s;\n const z = $cd53d4b312c9644c$var$fromAxisAngleScratch.z * s;\n const w = Math.cos(halfAngle);\n if (!(0, $jQJji.default)(result)) return new $cd53d4b312c9644c$var$Quaternion(x, y, z, w);\n result.x = x;\n result.y = y;\n result.z = z;\n result.w = w;\n return result;\n};\nconst $cd53d4b312c9644c$var$fromRotationMatrixNext = [\n 1,\n 2,\n 0\n];\nconst $cd53d4b312c9644c$var$fromRotationMatrixQuat = new Array(3);\n/**\n * Computes a Quaternion from the provided Matrix3 instance.\n *\n * @param {Matrix3} matrix The rotation matrix.\n * @param {Quaternion} [result] The object onto which to store the result.\n * @returns {Quaternion} The modified result parameter or a new Quaternion instance if one was not provided.\n *\n * @see Matrix3.fromQuaternion\n */ $cd53d4b312c9644c$var$Quaternion.fromRotationMatrix = function(matrix, result) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.object(\"matrix\", matrix);\n //>>includeEnd('debug');\n let root;\n let x;\n let y;\n let z;\n let w;\n const m00 = matrix[(0, $490279d1ff27cf6c$export$2e2bcd8739ae039).COLUMN0ROW0];\n const m11 = matrix[(0, $490279d1ff27cf6c$export$2e2bcd8739ae039).COLUMN1ROW1];\n const m22 = matrix[(0, $490279d1ff27cf6c$export$2e2bcd8739ae039).COLUMN2ROW2];\n const trace = m00 + m11 + m22;\n if (trace > 0.0) {\n // |w| > 1/2, may as well choose w > 1/2\n root = Math.sqrt(trace + 1.0); // 2w\n w = 0.5 * root;\n root = 0.5 / root; // 1/(4w)\n x = (matrix[(0, $490279d1ff27cf6c$export$2e2bcd8739ae039).COLUMN1ROW2] - matrix[(0, $490279d1ff27cf6c$export$2e2bcd8739ae039).COLUMN2ROW1]) * root;\n y = (matrix[(0, $490279d1ff27cf6c$export$2e2bcd8739ae039).COLUMN2ROW0] - matrix[(0, $490279d1ff27cf6c$export$2e2bcd8739ae039).COLUMN0ROW2]) * root;\n z = (matrix[(0, $490279d1ff27cf6c$export$2e2bcd8739ae039).COLUMN0ROW1] - matrix[(0, $490279d1ff27cf6c$export$2e2bcd8739ae039).COLUMN1ROW0]) * root;\n } else {\n // |w| <= 1/2\n const next = $cd53d4b312c9644c$var$fromRotationMatrixNext;\n let i = 0;\n if (m11 > m00) i = 1;\n if (m22 > m00 && m22 > m11) i = 2;\n const j = next[i];\n const k = next[j];\n root = Math.sqrt(matrix[(0, $490279d1ff27cf6c$export$2e2bcd8739ae039).getElementIndex(i, i)] - matrix[(0, $490279d1ff27cf6c$export$2e2bcd8739ae039).getElementIndex(j, j)] - matrix[(0, $490279d1ff27cf6c$export$2e2bcd8739ae039).getElementIndex(k, k)] + 1.0);\n const quat = $cd53d4b312c9644c$var$fromRotationMatrixQuat;\n quat[i] = 0.5 * root;\n root = 0.5 / root;\n w = (matrix[(0, $490279d1ff27cf6c$export$2e2bcd8739ae039).getElementIndex(k, j)] - matrix[(0, $490279d1ff27cf6c$export$2e2bcd8739ae039).getElementIndex(j, k)]) * root;\n quat[j] = (matrix[(0, $490279d1ff27cf6c$export$2e2bcd8739ae039).getElementIndex(j, i)] + matrix[(0, $490279d1ff27cf6c$export$2e2bcd8739ae039).getElementIndex(i, j)]) * root;\n quat[k] = (matrix[(0, $490279d1ff27cf6c$export$2e2bcd8739ae039).getElementIndex(k, i)] + matrix[(0, $490279d1ff27cf6c$export$2e2bcd8739ae039).getElementIndex(i, k)]) * root;\n x = -quat[0];\n y = -quat[1];\n z = -quat[2];\n }\n if (!(0, $jQJji.default)(result)) return new $cd53d4b312c9644c$var$Quaternion(x, y, z, w);\n result.x = x;\n result.y = y;\n result.z = z;\n result.w = w;\n return result;\n};\nconst $cd53d4b312c9644c$var$scratchHPRQuaternion = new $cd53d4b312c9644c$var$Quaternion();\nlet $cd53d4b312c9644c$var$scratchHeadingQuaternion = new $cd53d4b312c9644c$var$Quaternion();\nlet $cd53d4b312c9644c$var$scratchPitchQuaternion = new $cd53d4b312c9644c$var$Quaternion();\nlet $cd53d4b312c9644c$var$scratchRollQuaternion = new $cd53d4b312c9644c$var$Quaternion();\n/**\n * Computes a rotation from the given heading, pitch and roll angles. Heading is the rotation about the\n * negative z axis. Pitch is the rotation about the negative y axis. Roll is the rotation about\n * the positive x axis.\n *\n * @param {HeadingPitchRoll} headingPitchRoll The rotation expressed as a heading, pitch and roll.\n * @param {Quaternion} [result] The object onto which to store the result.\n * @returns {Quaternion} The modified result parameter or a new Quaternion instance if none was provided.\n */ $cd53d4b312c9644c$var$Quaternion.fromHeadingPitchRoll = function(headingPitchRoll, result) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.object(\"headingPitchRoll\", headingPitchRoll);\n //>>includeEnd('debug');\n $cd53d4b312c9644c$var$scratchRollQuaternion = $cd53d4b312c9644c$var$Quaternion.fromAxisAngle((0, $bXwZF.default).UNIT_X, headingPitchRoll.roll, $cd53d4b312c9644c$var$scratchHPRQuaternion);\n $cd53d4b312c9644c$var$scratchPitchQuaternion = $cd53d4b312c9644c$var$Quaternion.fromAxisAngle((0, $bXwZF.default).UNIT_Y, -headingPitchRoll.pitch, result);\n result = $cd53d4b312c9644c$var$Quaternion.multiply($cd53d4b312c9644c$var$scratchPitchQuaternion, $cd53d4b312c9644c$var$scratchRollQuaternion, $cd53d4b312c9644c$var$scratchPitchQuaternion);\n $cd53d4b312c9644c$var$scratchHeadingQuaternion = $cd53d4b312c9644c$var$Quaternion.fromAxisAngle((0, $bXwZF.default).UNIT_Z, -headingPitchRoll.heading, $cd53d4b312c9644c$var$scratchHPRQuaternion);\n return $cd53d4b312c9644c$var$Quaternion.multiply($cd53d4b312c9644c$var$scratchHeadingQuaternion, result, result);\n};\nconst $cd53d4b312c9644c$var$sampledQuaternionAxis = new (0, $bXwZF.default)();\nconst $cd53d4b312c9644c$var$sampledQuaternionRotation = new (0, $bXwZF.default)();\nconst $cd53d4b312c9644c$var$sampledQuaternionTempQuaternion = new $cd53d4b312c9644c$var$Quaternion();\nconst $cd53d4b312c9644c$var$sampledQuaternionQuaternion0 = new $cd53d4b312c9644c$var$Quaternion();\nconst $cd53d4b312c9644c$var$sampledQuaternionQuaternion0Conjugate = new $cd53d4b312c9644c$var$Quaternion();\n/**\n * The number of elements used to pack the object into an array.\n * @type {number}\n */ $cd53d4b312c9644c$var$Quaternion.packedLength = 4;\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {Quaternion} value The value to pack.\n * @param {number[]} array The array to pack into.\n * @param {number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {number[]} The array that was packed into\n */ $cd53d4b312c9644c$var$Quaternion.pack = function(value, array, startingIndex) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.object(\"value\", value);\n (0, $3pzcG.default).defined(\"array\", array);\n //>>includeEnd('debug');\n startingIndex = (0, $8w8ZH.default)(startingIndex, 0);\n array[startingIndex++] = value.x;\n array[startingIndex++] = value.y;\n array[startingIndex++] = value.z;\n array[startingIndex] = value.w;\n return array;\n};\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {number[]} array The packed array.\n * @param {number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {Quaternion} [result] The object into which to store the result.\n * @returns {Quaternion} The modified result parameter or a new Quaternion instance if one was not provided.\n */ $cd53d4b312c9644c$var$Quaternion.unpack = function(array, startingIndex, result) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).defined(\"array\", array);\n //>>includeEnd('debug');\n startingIndex = (0, $8w8ZH.default)(startingIndex, 0);\n if (!(0, $jQJji.default)(result)) result = new $cd53d4b312c9644c$var$Quaternion();\n result.x = array[startingIndex];\n result.y = array[startingIndex + 1];\n result.z = array[startingIndex + 2];\n result.w = array[startingIndex + 3];\n return result;\n};\n/**\n * The number of elements used to store the object into an array in its interpolatable form.\n * @type {number}\n */ $cd53d4b312c9644c$var$Quaternion.packedInterpolationLength = 3;\n/**\n * Converts a packed array into a form suitable for interpolation.\n *\n * @param {number[]} packedArray The packed array.\n * @param {number} [startingIndex=0] The index of the first element to be converted.\n * @param {number} [lastIndex=packedArray.length] The index of the last element to be converted.\n * @param {number[]} [result] The object into which to store the result.\n */ $cd53d4b312c9644c$var$Quaternion.convertPackedArrayForInterpolation = function(packedArray, startingIndex, lastIndex, result) {\n $cd53d4b312c9644c$var$Quaternion.unpack(packedArray, lastIndex * 4, $cd53d4b312c9644c$var$sampledQuaternionQuaternion0Conjugate);\n $cd53d4b312c9644c$var$Quaternion.conjugate($cd53d4b312c9644c$var$sampledQuaternionQuaternion0Conjugate, $cd53d4b312c9644c$var$sampledQuaternionQuaternion0Conjugate);\n for(let i = 0, len = lastIndex - startingIndex + 1; i < len; i++){\n const offset = i * 3;\n $cd53d4b312c9644c$var$Quaternion.unpack(packedArray, (startingIndex + i) * 4, $cd53d4b312c9644c$var$sampledQuaternionTempQuaternion);\n $cd53d4b312c9644c$var$Quaternion.multiply($cd53d4b312c9644c$var$sampledQuaternionTempQuaternion, $cd53d4b312c9644c$var$sampledQuaternionQuaternion0Conjugate, $cd53d4b312c9644c$var$sampledQuaternionTempQuaternion);\n if ($cd53d4b312c9644c$var$sampledQuaternionTempQuaternion.w < 0) $cd53d4b312c9644c$var$Quaternion.negate($cd53d4b312c9644c$var$sampledQuaternionTempQuaternion, $cd53d4b312c9644c$var$sampledQuaternionTempQuaternion);\n $cd53d4b312c9644c$var$Quaternion.computeAxis($cd53d4b312c9644c$var$sampledQuaternionTempQuaternion, $cd53d4b312c9644c$var$sampledQuaternionAxis);\n const angle = $cd53d4b312c9644c$var$Quaternion.computeAngle($cd53d4b312c9644c$var$sampledQuaternionTempQuaternion);\n if (!(0, $jQJji.default)(result)) result = [];\n result[offset] = $cd53d4b312c9644c$var$sampledQuaternionAxis.x * angle;\n result[offset + 1] = $cd53d4b312c9644c$var$sampledQuaternionAxis.y * angle;\n result[offset + 2] = $cd53d4b312c9644c$var$sampledQuaternionAxis.z * angle;\n }\n};\n/**\n * Retrieves an instance from a packed array converted with {@link convertPackedArrayForInterpolation}.\n *\n * @param {number[]} array The array previously packed for interpolation.\n * @param {number[]} sourceArray The original packed array.\n * @param {number} [firstIndex=0] The firstIndex used to convert the array.\n * @param {number} [lastIndex=packedArray.length] The lastIndex used to convert the array.\n * @param {Quaternion} [result] The object into which to store the result.\n * @returns {Quaternion} The modified result parameter or a new Quaternion instance if one was not provided.\n */ $cd53d4b312c9644c$var$Quaternion.unpackInterpolationResult = function(array, sourceArray, firstIndex, lastIndex, result) {\n if (!(0, $jQJji.default)(result)) result = new $cd53d4b312c9644c$var$Quaternion();\n (0, $bXwZF.default).fromArray(array, 0, $cd53d4b312c9644c$var$sampledQuaternionRotation);\n const magnitude = (0, $bXwZF.default).magnitude($cd53d4b312c9644c$var$sampledQuaternionRotation);\n $cd53d4b312c9644c$var$Quaternion.unpack(sourceArray, lastIndex * 4, $cd53d4b312c9644c$var$sampledQuaternionQuaternion0);\n if (magnitude === 0) $cd53d4b312c9644c$var$Quaternion.clone($cd53d4b312c9644c$var$Quaternion.IDENTITY, $cd53d4b312c9644c$var$sampledQuaternionTempQuaternion);\n else $cd53d4b312c9644c$var$Quaternion.fromAxisAngle($cd53d4b312c9644c$var$sampledQuaternionRotation, magnitude, $cd53d4b312c9644c$var$sampledQuaternionTempQuaternion);\n return $cd53d4b312c9644c$var$Quaternion.multiply($cd53d4b312c9644c$var$sampledQuaternionTempQuaternion, $cd53d4b312c9644c$var$sampledQuaternionQuaternion0, result);\n};\n/**\n * Duplicates a Quaternion instance.\n *\n * @param {Quaternion} quaternion The quaternion to duplicate.\n * @param {Quaternion} [result] The object onto which to store the result.\n * @returns {Quaternion} The modified result parameter or a new Quaternion instance if one was not provided. (Returns undefined if quaternion is undefined)\n */ $cd53d4b312c9644c$var$Quaternion.clone = function(quaternion, result) {\n if (!(0, $jQJji.default)(quaternion)) return undefined;\n if (!(0, $jQJji.default)(result)) return new $cd53d4b312c9644c$var$Quaternion(quaternion.x, quaternion.y, quaternion.z, quaternion.w);\n result.x = quaternion.x;\n result.y = quaternion.y;\n result.z = quaternion.z;\n result.w = quaternion.w;\n return result;\n};\n/**\n * Computes the conjugate of the provided quaternion.\n *\n * @param {Quaternion} quaternion The quaternion to conjugate.\n * @param {Quaternion} result The object onto which to store the result.\n * @returns {Quaternion} The modified result parameter.\n */ $cd53d4b312c9644c$var$Quaternion.conjugate = function(quaternion, result) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.object(\"quaternion\", quaternion);\n (0, $3pzcG.default).typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n result.x = -quaternion.x;\n result.y = -quaternion.y;\n result.z = -quaternion.z;\n result.w = quaternion.w;\n return result;\n};\n/**\n * Computes magnitude squared for the provided quaternion.\n *\n * @param {Quaternion} quaternion The quaternion to conjugate.\n * @returns {number} The magnitude squared.\n */ $cd53d4b312c9644c$var$Quaternion.magnitudeSquared = function(quaternion) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.object(\"quaternion\", quaternion);\n //>>includeEnd('debug');\n return quaternion.x * quaternion.x + quaternion.y * quaternion.y + quaternion.z * quaternion.z + quaternion.w * quaternion.w;\n};\n/**\n * Computes magnitude for the provided quaternion.\n *\n * @param {Quaternion} quaternion The quaternion to conjugate.\n * @returns {number} The magnitude.\n */ $cd53d4b312c9644c$var$Quaternion.magnitude = function(quaternion) {\n return Math.sqrt($cd53d4b312c9644c$var$Quaternion.magnitudeSquared(quaternion));\n};\n/**\n * Computes the normalized form of the provided quaternion.\n *\n * @param {Quaternion} quaternion The quaternion to normalize.\n * @param {Quaternion} result The object onto which to store the result.\n * @returns {Quaternion} The modified result parameter.\n */ $cd53d4b312c9644c$var$Quaternion.normalize = function(quaternion, result) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n const inverseMagnitude = 1.0 / $cd53d4b312c9644c$var$Quaternion.magnitude(quaternion);\n const x = quaternion.x * inverseMagnitude;\n const y = quaternion.y * inverseMagnitude;\n const z = quaternion.z * inverseMagnitude;\n const w = quaternion.w * inverseMagnitude;\n result.x = x;\n result.y = y;\n result.z = z;\n result.w = w;\n return result;\n};\n/**\n * Computes the inverse of the provided quaternion.\n *\n * @param {Quaternion} quaternion The quaternion to normalize.\n * @param {Quaternion} result The object onto which to store the result.\n * @returns {Quaternion} The modified result parameter.\n */ $cd53d4b312c9644c$var$Quaternion.inverse = function(quaternion, result) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n const magnitudeSquared = $cd53d4b312c9644c$var$Quaternion.magnitudeSquared(quaternion);\n result = $cd53d4b312c9644c$var$Quaternion.conjugate(quaternion, result);\n return $cd53d4b312c9644c$var$Quaternion.multiplyByScalar(result, 1.0 / magnitudeSquared, result);\n};\n/**\n * Computes the componentwise sum of two quaternions.\n *\n * @param {Quaternion} left The first quaternion.\n * @param {Quaternion} right The second quaternion.\n * @param {Quaternion} result The object onto which to store the result.\n * @returns {Quaternion} The modified result parameter.\n */ $cd53d4b312c9644c$var$Quaternion.add = function(left, right, result) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.object(\"left\", left);\n (0, $3pzcG.default).typeOf.object(\"right\", right);\n (0, $3pzcG.default).typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n result.x = left.x + right.x;\n result.y = left.y + right.y;\n result.z = left.z + right.z;\n result.w = left.w + right.w;\n return result;\n};\n/**\n * Computes the componentwise difference of two quaternions.\n *\n * @param {Quaternion} left The first quaternion.\n * @param {Quaternion} right The second quaternion.\n * @param {Quaternion} result The object onto which to store the result.\n * @returns {Quaternion} The modified result parameter.\n */ $cd53d4b312c9644c$var$Quaternion.subtract = function(left, right, result) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.object(\"left\", left);\n (0, $3pzcG.default).typeOf.object(\"right\", right);\n (0, $3pzcG.default).typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n result.x = left.x - right.x;\n result.y = left.y - right.y;\n result.z = left.z - right.z;\n result.w = left.w - right.w;\n return result;\n};\n/**\n * Negates the provided quaternion.\n *\n * @param {Quaternion} quaternion The quaternion to be negated.\n * @param {Quaternion} result The object onto which to store the result.\n * @returns {Quaternion} The modified result parameter.\n */ $cd53d4b312c9644c$var$Quaternion.negate = function(quaternion, result) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.object(\"quaternion\", quaternion);\n (0, $3pzcG.default).typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n result.x = -quaternion.x;\n result.y = -quaternion.y;\n result.z = -quaternion.z;\n result.w = -quaternion.w;\n return result;\n};\n/**\n * Computes the dot (scalar) product of two quaternions.\n *\n * @param {Quaternion} left The first quaternion.\n * @param {Quaternion} right The second quaternion.\n * @returns {number} The dot product.\n */ $cd53d4b312c9644c$var$Quaternion.dot = function(left, right) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.object(\"left\", left);\n (0, $3pzcG.default).typeOf.object(\"right\", right);\n //>>includeEnd('debug');\n return left.x * right.x + left.y * right.y + left.z * right.z + left.w * right.w;\n};\n/**\n * Computes the product of two quaternions.\n *\n * @param {Quaternion} left The first quaternion.\n * @param {Quaternion} right The second quaternion.\n * @param {Quaternion} result The object onto which to store the result.\n * @returns {Quaternion} The modified result parameter.\n */ $cd53d4b312c9644c$var$Quaternion.multiply = function(left, right, result) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.object(\"left\", left);\n (0, $3pzcG.default).typeOf.object(\"right\", right);\n (0, $3pzcG.default).typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n const leftX = left.x;\n const leftY = left.y;\n const leftZ = left.z;\n const leftW = left.w;\n const rightX = right.x;\n const rightY = right.y;\n const rightZ = right.z;\n const rightW = right.w;\n const x = leftW * rightX + leftX * rightW + leftY * rightZ - leftZ * rightY;\n const y = leftW * rightY - leftX * rightZ + leftY * rightW + leftZ * rightX;\n const z = leftW * rightZ + leftX * rightY - leftY * rightX + leftZ * rightW;\n const w = leftW * rightW - leftX * rightX - leftY * rightY - leftZ * rightZ;\n result.x = x;\n result.y = y;\n result.z = z;\n result.w = w;\n return result;\n};\n/**\n * Multiplies the provided quaternion componentwise by the provided scalar.\n *\n * @param {Quaternion} quaternion The quaternion to be scaled.\n * @param {number} scalar The scalar to multiply with.\n * @param {Quaternion} result The object onto which to store the result.\n * @returns {Quaternion} The modified result parameter.\n */ $cd53d4b312c9644c$var$Quaternion.multiplyByScalar = function(quaternion, scalar, result) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.object(\"quaternion\", quaternion);\n (0, $3pzcG.default).typeOf.number(\"scalar\", scalar);\n (0, $3pzcG.default).typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n result.x = quaternion.x * scalar;\n result.y = quaternion.y * scalar;\n result.z = quaternion.z * scalar;\n result.w = quaternion.w * scalar;\n return result;\n};\n/**\n * Divides the provided quaternion componentwise by the provided scalar.\n *\n * @param {Quaternion} quaternion The quaternion to be divided.\n * @param {number} scalar The scalar to divide by.\n * @param {Quaternion} result The object onto which to store the result.\n * @returns {Quaternion} The modified result parameter.\n */ $cd53d4b312c9644c$var$Quaternion.divideByScalar = function(quaternion, scalar, result) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.object(\"quaternion\", quaternion);\n (0, $3pzcG.default).typeOf.number(\"scalar\", scalar);\n (0, $3pzcG.default).typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n result.x = quaternion.x / scalar;\n result.y = quaternion.y / scalar;\n result.z = quaternion.z / scalar;\n result.w = quaternion.w / scalar;\n return result;\n};\n/**\n * Computes the axis of rotation of the provided quaternion.\n *\n * @param {Quaternion} quaternion The quaternion to use.\n * @param {Cartesian3} result The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter.\n */ $cd53d4b312c9644c$var$Quaternion.computeAxis = function(quaternion, result) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.object(\"quaternion\", quaternion);\n (0, $3pzcG.default).typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n const w = quaternion.w;\n if (Math.abs(w - 1.0) < (0, $AXvpI.default).EPSILON6 || Math.abs(w + 1.0) < (0, $AXvpI.default).EPSILON6) {\n result.x = 1;\n result.y = result.z = 0;\n return result;\n }\n const scalar = 1.0 / Math.sqrt(1.0 - w * w);\n result.x = quaternion.x * scalar;\n result.y = quaternion.y * scalar;\n result.z = quaternion.z * scalar;\n return result;\n};\n/**\n * Computes the angle of rotation of the provided quaternion.\n *\n * @param {Quaternion} quaternion The quaternion to use.\n * @returns {number} The angle of rotation.\n */ $cd53d4b312c9644c$var$Quaternion.computeAngle = function(quaternion) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.object(\"quaternion\", quaternion);\n //>>includeEnd('debug');\n if (Math.abs(quaternion.w - 1.0) < (0, $AXvpI.default).EPSILON6) return 0.0;\n return 2.0 * Math.acos(quaternion.w);\n};\nlet $cd53d4b312c9644c$var$lerpScratch = new $cd53d4b312c9644c$var$Quaternion();\n/**\n * Computes the linear interpolation or extrapolation at t using the provided quaternions.\n *\n * @param {Quaternion} start The value corresponding to t at 0.0.\n * @param {Quaternion} end The value corresponding to t at 1.0.\n * @param {number} t The point along t at which to interpolate.\n * @param {Quaternion} result The object onto which to store the result.\n * @returns {Quaternion} The modified result parameter.\n */ $cd53d4b312c9644c$var$Quaternion.lerp = function(start, end, t, result) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.object(\"start\", start);\n (0, $3pzcG.default).typeOf.object(\"end\", end);\n (0, $3pzcG.default).typeOf.number(\"t\", t);\n (0, $3pzcG.default).typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n $cd53d4b312c9644c$var$lerpScratch = $cd53d4b312c9644c$var$Quaternion.multiplyByScalar(end, t, $cd53d4b312c9644c$var$lerpScratch);\n result = $cd53d4b312c9644c$var$Quaternion.multiplyByScalar(start, 1.0 - t, result);\n return $cd53d4b312c9644c$var$Quaternion.add($cd53d4b312c9644c$var$lerpScratch, result, result);\n};\nlet $cd53d4b312c9644c$var$slerpEndNegated = new $cd53d4b312c9644c$var$Quaternion();\nlet $cd53d4b312c9644c$var$slerpScaledP = new $cd53d4b312c9644c$var$Quaternion();\nlet $cd53d4b312c9644c$var$slerpScaledR = new $cd53d4b312c9644c$var$Quaternion();\n/**\n * Computes the spherical linear interpolation or extrapolation at t using the provided quaternions.\n *\n * @param {Quaternion} start The value corresponding to t at 0.0.\n * @param {Quaternion} end The value corresponding to t at 1.0.\n * @param {number} t The point along t at which to interpolate.\n * @param {Quaternion} result The object onto which to store the result.\n * @returns {Quaternion} The modified result parameter.\n *\n * @see Quaternion#fastSlerp\n */ $cd53d4b312c9644c$var$Quaternion.slerp = function(start, end, t, result) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.object(\"start\", start);\n (0, $3pzcG.default).typeOf.object(\"end\", end);\n (0, $3pzcG.default).typeOf.number(\"t\", t);\n (0, $3pzcG.default).typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n let dot = $cd53d4b312c9644c$var$Quaternion.dot(start, end);\n // The angle between start must be acute. Since q and -q represent\n // the same rotation, negate q to get the acute angle.\n let r = end;\n if (dot < 0.0) {\n dot = -dot;\n r = $cd53d4b312c9644c$var$slerpEndNegated = $cd53d4b312c9644c$var$Quaternion.negate(end, $cd53d4b312c9644c$var$slerpEndNegated);\n }\n // dot > 0, as the dot product approaches 1, the angle between the\n // quaternions vanishes. use linear interpolation.\n if (1.0 - dot < (0, $AXvpI.default).EPSILON6) return $cd53d4b312c9644c$var$Quaternion.lerp(start, r, t, result);\n const theta = Math.acos(dot);\n $cd53d4b312c9644c$var$slerpScaledP = $cd53d4b312c9644c$var$Quaternion.multiplyByScalar(start, Math.sin((1 - t) * theta), $cd53d4b312c9644c$var$slerpScaledP);\n $cd53d4b312c9644c$var$slerpScaledR = $cd53d4b312c9644c$var$Quaternion.multiplyByScalar(r, Math.sin(t * theta), $cd53d4b312c9644c$var$slerpScaledR);\n result = $cd53d4b312c9644c$var$Quaternion.add($cd53d4b312c9644c$var$slerpScaledP, $cd53d4b312c9644c$var$slerpScaledR, result);\n return $cd53d4b312c9644c$var$Quaternion.multiplyByScalar(result, 1.0 / Math.sin(theta), result);\n};\n/**\n * The logarithmic quaternion function.\n *\n * @param {Quaternion} quaternion The unit quaternion.\n * @param {Cartesian3} result The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter.\n */ $cd53d4b312c9644c$var$Quaternion.log = function(quaternion, result) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.object(\"quaternion\", quaternion);\n (0, $3pzcG.default).typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n const theta = (0, $AXvpI.default).acosClamped(quaternion.w);\n let thetaOverSinTheta = 0.0;\n if (theta !== 0.0) thetaOverSinTheta = theta / Math.sin(theta);\n return (0, $bXwZF.default).multiplyByScalar(quaternion, thetaOverSinTheta, result);\n};\n/**\n * The exponential quaternion function.\n *\n * @param {Cartesian3} cartesian The cartesian.\n * @param {Quaternion} result The object onto which to store the result.\n * @returns {Quaternion} The modified result parameter.\n */ $cd53d4b312c9644c$var$Quaternion.exp = function(cartesian, result) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.object(\"cartesian\", cartesian);\n (0, $3pzcG.default).typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n const theta = (0, $bXwZF.default).magnitude(cartesian);\n let sinThetaOverTheta = 0.0;\n if (theta !== 0.0) sinThetaOverTheta = Math.sin(theta) / theta;\n result.x = cartesian.x * sinThetaOverTheta;\n result.y = cartesian.y * sinThetaOverTheta;\n result.z = cartesian.z * sinThetaOverTheta;\n result.w = Math.cos(theta);\n return result;\n};\nconst $cd53d4b312c9644c$var$squadScratchCartesian0 = new (0, $bXwZF.default)();\nconst $cd53d4b312c9644c$var$squadScratchCartesian1 = new (0, $bXwZF.default)();\nconst $cd53d4b312c9644c$var$squadScratchQuaternion0 = new $cd53d4b312c9644c$var$Quaternion();\nconst $cd53d4b312c9644c$var$squadScratchQuaternion1 = new $cd53d4b312c9644c$var$Quaternion();\n/**\n * Computes an inner quadrangle point.\n * This will compute quaternions that ensure a squad curve is C1.
\n *\n * @param {Quaternion} q0 The first quaternion.\n * @param {Quaternion} q1 The second quaternion.\n * @param {Quaternion} q2 The third quaternion.\n * @param {Quaternion} result The object onto which to store the result.\n * @returns {Quaternion} The modified result parameter.\n *\n * @see Quaternion#squad\n */ $cd53d4b312c9644c$var$Quaternion.computeInnerQuadrangle = function(q0, q1, q2, result) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.object(\"q0\", q0);\n (0, $3pzcG.default).typeOf.object(\"q1\", q1);\n (0, $3pzcG.default).typeOf.object(\"q2\", q2);\n (0, $3pzcG.default).typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n const qInv = $cd53d4b312c9644c$var$Quaternion.conjugate(q1, $cd53d4b312c9644c$var$squadScratchQuaternion0);\n $cd53d4b312c9644c$var$Quaternion.multiply(qInv, q2, $cd53d4b312c9644c$var$squadScratchQuaternion1);\n const cart0 = $cd53d4b312c9644c$var$Quaternion.log($cd53d4b312c9644c$var$squadScratchQuaternion1, $cd53d4b312c9644c$var$squadScratchCartesian0);\n $cd53d4b312c9644c$var$Quaternion.multiply(qInv, q0, $cd53d4b312c9644c$var$squadScratchQuaternion1);\n const cart1 = $cd53d4b312c9644c$var$Quaternion.log($cd53d4b312c9644c$var$squadScratchQuaternion1, $cd53d4b312c9644c$var$squadScratchCartesian1);\n (0, $bXwZF.default).add(cart0, cart1, cart0);\n (0, $bXwZF.default).multiplyByScalar(cart0, 0.25, cart0);\n (0, $bXwZF.default).negate(cart0, cart0);\n $cd53d4b312c9644c$var$Quaternion.exp(cart0, $cd53d4b312c9644c$var$squadScratchQuaternion0);\n return $cd53d4b312c9644c$var$Quaternion.multiply(q1, $cd53d4b312c9644c$var$squadScratchQuaternion0, result);\n};\n/**\n * Computes the spherical quadrangle interpolation between quaternions.\n *\n * @param {Quaternion} q0 The first quaternion.\n * @param {Quaternion} q1 The second quaternion.\n * @param {Quaternion} s0 The first inner quadrangle.\n * @param {Quaternion} s1 The second inner quadrangle.\n * @param {number} t The time in [0,1] used to interpolate.\n * @param {Quaternion} result The object onto which to store the result.\n * @returns {Quaternion} The modified result parameter.\n *\n *\n * @example\n * // 1. compute the squad interpolation between two quaternions on a curve\n * const s0 = Cesium.Quaternion.computeInnerQuadrangle(quaternions[i - 1], quaternions[i], quaternions[i + 1], new Cesium.Quaternion());\n * const s1 = Cesium.Quaternion.computeInnerQuadrangle(quaternions[i], quaternions[i + 1], quaternions[i + 2], new Cesium.Quaternion());\n * const q = Cesium.Quaternion.squad(quaternions[i], quaternions[i + 1], s0, s1, t, new Cesium.Quaternion());\n *\n * // 2. compute the squad interpolation as above but where the first quaternion is a end point.\n * const s1 = Cesium.Quaternion.computeInnerQuadrangle(quaternions[0], quaternions[1], quaternions[2], new Cesium.Quaternion());\n * const q = Cesium.Quaternion.squad(quaternions[0], quaternions[1], quaternions[0], s1, t, new Cesium.Quaternion());\n *\n * @see Quaternion#computeInnerQuadrangle\n */ $cd53d4b312c9644c$var$Quaternion.squad = function(q0, q1, s0, s1, t, result) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.object(\"q0\", q0);\n (0, $3pzcG.default).typeOf.object(\"q1\", q1);\n (0, $3pzcG.default).typeOf.object(\"s0\", s0);\n (0, $3pzcG.default).typeOf.object(\"s1\", s1);\n (0, $3pzcG.default).typeOf.number(\"t\", t);\n (0, $3pzcG.default).typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n const slerp0 = $cd53d4b312c9644c$var$Quaternion.slerp(q0, q1, t, $cd53d4b312c9644c$var$squadScratchQuaternion0);\n const slerp1 = $cd53d4b312c9644c$var$Quaternion.slerp(s0, s1, t, $cd53d4b312c9644c$var$squadScratchQuaternion1);\n return $cd53d4b312c9644c$var$Quaternion.slerp(slerp0, slerp1, 2.0 * t * (1.0 - t), result);\n};\nconst $cd53d4b312c9644c$var$fastSlerpScratchQuaternion = new $cd53d4b312c9644c$var$Quaternion();\n// eslint-disable-next-line no-loss-of-precision\nconst $cd53d4b312c9644c$var$opmu = 1.90110745351730037;\nconst $cd53d4b312c9644c$var$u = (0, $da149e13e9eaa5f6$export$2e2bcd8739ae039).supportsTypedArrays() ? new Float32Array(8) : [];\nconst $cd53d4b312c9644c$var$v = (0, $da149e13e9eaa5f6$export$2e2bcd8739ae039).supportsTypedArrays() ? new Float32Array(8) : [];\nconst $cd53d4b312c9644c$var$bT = (0, $da149e13e9eaa5f6$export$2e2bcd8739ae039).supportsTypedArrays() ? new Float32Array(8) : [];\nconst $cd53d4b312c9644c$var$bD = (0, $da149e13e9eaa5f6$export$2e2bcd8739ae039).supportsTypedArrays() ? new Float32Array(8) : [];\nfor(let i = 0; i < 7; ++i){\n const s = i + 1.0;\n const t = 2.0 * s + 1.0;\n $cd53d4b312c9644c$var$u[i] = 1.0 / (s * t);\n $cd53d4b312c9644c$var$v[i] = s / t;\n}\n$cd53d4b312c9644c$var$u[7] = $cd53d4b312c9644c$var$opmu / 136;\n$cd53d4b312c9644c$var$v[7] = $cd53d4b312c9644c$var$opmu * 8.0 / 17.0;\n/**\n * Computes the spherical linear interpolation or extrapolation at t using the provided quaternions.\n * This implementation is faster than {@link Quaternion#slerp}, but is only accurate up to 10-6.\n *\n * @param {Quaternion} start The value corresponding to t at 0.0.\n * @param {Quaternion} end The value corresponding to t at 1.0.\n * @param {number} t The point along t at which to interpolate.\n * @param {Quaternion} result The object onto which to store the result.\n * @returns {Quaternion} The modified result parameter.\n *\n * @see Quaternion#slerp\n */ $cd53d4b312c9644c$var$Quaternion.fastSlerp = function(start, end, t, result) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.object(\"start\", start);\n (0, $3pzcG.default).typeOf.object(\"end\", end);\n (0, $3pzcG.default).typeOf.number(\"t\", t);\n (0, $3pzcG.default).typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n let x = $cd53d4b312c9644c$var$Quaternion.dot(start, end);\n let sign;\n if (x >= 0) sign = 1.0;\n else {\n sign = -1;\n x = -x;\n }\n const xm1 = x - 1.0;\n const d = 1.0 - t;\n const sqrT = t * t;\n const sqrD = d * d;\n for(let i = 7; i >= 0; --i){\n $cd53d4b312c9644c$var$bT[i] = ($cd53d4b312c9644c$var$u[i] * sqrT - $cd53d4b312c9644c$var$v[i]) * xm1;\n $cd53d4b312c9644c$var$bD[i] = ($cd53d4b312c9644c$var$u[i] * sqrD - $cd53d4b312c9644c$var$v[i]) * xm1;\n }\n const cT = sign * t * (1.0 + $cd53d4b312c9644c$var$bT[0] * (1.0 + $cd53d4b312c9644c$var$bT[1] * (1.0 + $cd53d4b312c9644c$var$bT[2] * (1.0 + $cd53d4b312c9644c$var$bT[3] * (1.0 + $cd53d4b312c9644c$var$bT[4] * (1.0 + $cd53d4b312c9644c$var$bT[5] * (1.0 + $cd53d4b312c9644c$var$bT[6] * (1.0 + $cd53d4b312c9644c$var$bT[7]))))))));\n const cD = d * (1.0 + $cd53d4b312c9644c$var$bD[0] * (1.0 + $cd53d4b312c9644c$var$bD[1] * (1.0 + $cd53d4b312c9644c$var$bD[2] * (1.0 + $cd53d4b312c9644c$var$bD[3] * (1.0 + $cd53d4b312c9644c$var$bD[4] * (1.0 + $cd53d4b312c9644c$var$bD[5] * (1.0 + $cd53d4b312c9644c$var$bD[6] * (1.0 + $cd53d4b312c9644c$var$bD[7]))))))));\n const temp = $cd53d4b312c9644c$var$Quaternion.multiplyByScalar(start, cD, $cd53d4b312c9644c$var$fastSlerpScratchQuaternion);\n $cd53d4b312c9644c$var$Quaternion.multiplyByScalar(end, cT, result);\n return $cd53d4b312c9644c$var$Quaternion.add(temp, result, result);\n};\n/**\n * Computes the spherical quadrangle interpolation between quaternions.\n * An implementation that is faster than {@link Quaternion#squad}, but less accurate.\n *\n * @param {Quaternion} q0 The first quaternion.\n * @param {Quaternion} q1 The second quaternion.\n * @param {Quaternion} s0 The first inner quadrangle.\n * @param {Quaternion} s1 The second inner quadrangle.\n * @param {number} t The time in [0,1] used to interpolate.\n * @param {Quaternion} result The object onto which to store the result.\n * @returns {Quaternion} The modified result parameter or a new instance if none was provided.\n *\n * @see Quaternion#squad\n */ $cd53d4b312c9644c$var$Quaternion.fastSquad = function(q0, q1, s0, s1, t, result) {\n //>>includeStart('debug', pragmas.debug);\n (0, $3pzcG.default).typeOf.object(\"q0\", q0);\n (0, $3pzcG.default).typeOf.object(\"q1\", q1);\n (0, $3pzcG.default).typeOf.object(\"s0\", s0);\n (0, $3pzcG.default).typeOf.object(\"s1\", s1);\n (0, $3pzcG.default).typeOf.number(\"t\", t);\n (0, $3pzcG.default).typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n const slerp0 = $cd53d4b312c9644c$var$Quaternion.fastSlerp(q0, q1, t, $cd53d4b312c9644c$var$squadScratchQuaternion0);\n const slerp1 = $cd53d4b312c9644c$var$Quaternion.fastSlerp(s0, s1, t, $cd53d4b312c9644c$var$squadScratchQuaternion1);\n return $cd53d4b312c9644c$var$Quaternion.fastSlerp(slerp0, slerp1, 2.0 * t * (1.0 - t), result);\n};\n/**\n * Compares the provided quaternions componentwise and returns\n *true
if they are equal, false
otherwise.\n *\n * @param {Quaternion} [left] The first quaternion.\n * @param {Quaternion} [right] The second quaternion.\n * @returns {boolean} true
if left and right are equal, false
otherwise.\n */ $cd53d4b312c9644c$var$Quaternion.equals = function(left, right) {\n return left === right || (0, $jQJji.default)(left) && (0, $jQJji.default)(right) && left.x === right.x && left.y === right.y && left.z === right.z && left.w === right.w;\n};\n/**\n * Compares the provided quaternions componentwise and returns\n * true
if they are within the provided epsilon,\n * false
otherwise.\n *\n * @param {Quaternion} [left] The first quaternion.\n * @param {Quaternion} [right] The second quaternion.\n * @param {number} [epsilon=0] The epsilon to use for equality testing.\n * @returns {boolean} true
if left and right are within the provided epsilon, false
otherwise.\n */ $cd53d4b312c9644c$var$Quaternion.equalsEpsilon = function(left, right, epsilon) {\n epsilon = (0, $8w8ZH.default)(epsilon, 0);\n return left === right || (0, $jQJji.default)(left) && (0, $jQJji.default)(right) && Math.abs(left.x - right.x) <= epsilon && Math.abs(left.y - right.y) <= epsilon && Math.abs(left.z - right.z) <= epsilon && Math.abs(left.w - right.w) <= epsilon;\n};\n/**\n * An immutable Quaternion instance initialized to (0.0, 0.0, 0.0, 0.0).\n *\n * @type {Quaternion}\n * @constant\n */ $cd53d4b312c9644c$var$Quaternion.ZERO = Object.freeze(new $cd53d4b312c9644c$var$Quaternion(0.0, 0.0, 0.0, 0.0));\n/**\n * An immutable Quaternion instance initialized to (0.0, 0.0, 0.0, 1.0).\n *\n * @type {Quaternion}\n * @constant\n */ $cd53d4b312c9644c$var$Quaternion.IDENTITY = Object.freeze(new $cd53d4b312c9644c$var$Quaternion(0.0, 0.0, 0.0, 1.0));\n/**\n * Duplicates this Quaternion instance.\n *\n * @param {Quaternion} [result] The object onto which to store the result.\n * @returns {Quaternion} The modified result parameter or a new Quaternion instance if one was not provided.\n */ $cd53d4b312c9644c$var$Quaternion.prototype.clone = function(result) {\n return $cd53d4b312c9644c$var$Quaternion.clone(this, result);\n};\n/**\n * Compares this and the provided quaternion componentwise and returns\n * true
if they are equal, false
otherwise.\n *\n * @param {Quaternion} [right] The right hand side quaternion.\n * @returns {boolean} true
if left and right are equal, false
otherwise.\n */ $cd53d4b312c9644c$var$Quaternion.prototype.equals = function(right) {\n return $cd53d4b312c9644c$var$Quaternion.equals(this, right);\n};\n/**\n * Compares this and the provided quaternion componentwise and returns\n * true
if they are within the provided epsilon,\n * false
otherwise.\n *\n * @param {Quaternion} [right] The right hand side quaternion.\n * @param {number} [epsilon=0] The epsilon to use for equality testing.\n * @returns {boolean} true
if left and right are within the provided epsilon, false
otherwise.\n */ $cd53d4b312c9644c$var$Quaternion.prototype.equalsEpsilon = function(right, epsilon) {\n return $cd53d4b312c9644c$var$Quaternion.equalsEpsilon(this, right, epsilon);\n};\n/**\n * Returns a string representing this quaternion in the format (x, y, z, w).\n *\n * @returns {string} A string representing this Quaternion.\n */ $cd53d4b312c9644c$var$Quaternion.prototype.toString = function() {\n return `(${this.x}, ${this.y}, ${this.z}, ${this.w})`;\n};\nvar $cd53d4b312c9644c$export$2e2bcd8739ae039 = $cd53d4b312c9644c$var$Quaternion;\n\n\n\n/**\n * Contains functions for transforming positions to various reference frames.\n *\n * @namespace Transforms\n */ const $128fc127c88fc802$var$Transforms = {};\nconst $128fc127c88fc802$var$vectorProductLocalFrame = {\n up: {\n south: \"east\",\n north: \"west\",\n west: \"south\",\n east: \"north\"\n },\n down: {\n south: \"west\",\n north: \"east\",\n west: \"north\",\n east: \"south\"\n },\n south: {\n up: \"west\",\n down: \"east\",\n west: \"down\",\n east: \"up\"\n },\n north: {\n up: \"east\",\n down: \"west\",\n west: \"up\",\n east: \"down\"\n },\n west: {\n up: \"north\",\n down: \"south\",\n north: \"down\",\n south: \"up\"\n },\n east: {\n up: \"south\",\n down: \"north\",\n north: \"up\",\n south: \"down\"\n }\n};\nconst $128fc127c88fc802$var$degeneratePositionLocalFrame = {\n north: [\n -1,\n 0,\n 0\n ],\n east: [\n 0,\n 1,\n 0\n ],\n up: [\n 0,\n 0,\n 1\n ],\n south: [\n 1,\n 0,\n 0\n ],\n west: [\n 0,\n -1,\n 0\n ],\n down: [\n 0,\n 0,\n -1\n ]\n};\nconst $128fc127c88fc802$var$localFrameToFixedFrameCache = {};\nconst $128fc127c88fc802$var$scratchCalculateCartesian = {\n east: new (0, $bXwZF.default)(),\n north: new (0, $bXwZF.default)(),\n up: new (0, $bXwZF.default)(),\n west: new (0, $bXwZF.default)(),\n south: new (0, $bXwZF.default)(),\n down: new (0, $bXwZF.default)()\n};\nlet $128fc127c88fc802$var$scratchFirstCartesian = new (0, $bXwZF.default)();\nlet $128fc127c88fc802$var$scratchSecondCartesian = new (0, $bXwZF.default)();\nlet $128fc127c88fc802$var$scratchThirdCartesian = new (0, $bXwZF.default)();\n/**\n * Generates a function that computes a 4x4 transformation matrix from a reference frame\n * centered at the provided origin to the provided ellipsoid's fixed reference frame.\n * @param {string} firstAxis name of the first axis of the local reference frame. Must be\n * 'east', 'north', 'up', 'west', 'south' or 'down'.\n * @param {string} secondAxis name of the second axis of the local reference frame. Must be\n * 'east', 'north', 'up', 'west', 'south' or 'down'.\n * @return {Transforms.LocalFrameToFixedFrame} The function that will computes a\n * 4x4 transformation matrix from a reference frame, with first axis and second axis compliant with the parameters,\n */ $128fc127c88fc802$var$Transforms.localFrameToFixedFrameGenerator = function(firstAxis, secondAxis) {\n if (!$128fc127c88fc802$var$vectorProductLocalFrame.hasOwnProperty(firstAxis) || !$128fc127c88fc802$var$vectorProductLocalFrame[firstAxis].hasOwnProperty(secondAxis)) throw new (0, $1vHsR.default)(\"firstAxis and secondAxis must be east, north, up, west, south or down.\");\n const thirdAxis = $128fc127c88fc802$var$vectorProductLocalFrame[firstAxis][secondAxis];\n /**\n * Computes a 4x4 transformation matrix from a reference frame\n * centered at the provided origin to the provided ellipsoid's fixed reference frame.\n * @callback Transforms.LocalFrameToFixedFrame\n * @param {Cartesian3} origin The center point of the local reference frame.\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.default] The ellipsoid whose fixed frame is used in the transformation.\n * @param {Matrix4} [result] The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter or a new Matrix4 instance if none was provided.\n */ let resultat;\n const hashAxis = firstAxis + secondAxis;\n if ((0, $jQJji.default)($128fc127c88fc802$var$localFrameToFixedFrameCache[hashAxis])) resultat = $128fc127c88fc802$var$localFrameToFixedFrameCache[hashAxis];\n else {\n resultat = function(origin, ellipsoid, result) {\n //>>includeStart('debug', pragmas.debug);\n if (!(0, $jQJji.default)(origin)) throw new (0, $1vHsR.default)(\"origin is required.\");\n if (isNaN(origin.x) || isNaN(origin.y) || isNaN(origin.z)) throw new (0, $1vHsR.default)(\"origin has a NaN component\");\n //>>includeEnd('debug');\n if (!(0, $jQJji.default)(result)) result = new (0, $7ec6ab76c28fee32$export$2e2bcd8739ae039)();\n if ((0, $bXwZF.default).equalsEpsilon(origin, (0, $bXwZF.default).ZERO, (0, $AXvpI.default).EPSILON14)) {\n // If x, y, and z are zero, use the degenerate local frame, which is a special case\n (0, $bXwZF.default).unpack($128fc127c88fc802$var$degeneratePositionLocalFrame[firstAxis], 0, $128fc127c88fc802$var$scratchFirstCartesian);\n (0, $bXwZF.default).unpack($128fc127c88fc802$var$degeneratePositionLocalFrame[secondAxis], 0, $128fc127c88fc802$var$scratchSecondCartesian);\n (0, $bXwZF.default).unpack($128fc127c88fc802$var$degeneratePositionLocalFrame[thirdAxis], 0, $128fc127c88fc802$var$scratchThirdCartesian);\n } else if ((0, $AXvpI.default).equalsEpsilon(origin.x, 0.0, (0, $AXvpI.default).EPSILON14) && (0, $AXvpI.default).equalsEpsilon(origin.y, 0.0, (0, $AXvpI.default).EPSILON14)) {\n // If x and y are zero, assume origin is at a pole, which is a special case.\n const sign = (0, $AXvpI.default).sign(origin.z);\n (0, $bXwZF.default).unpack($128fc127c88fc802$var$degeneratePositionLocalFrame[firstAxis], 0, $128fc127c88fc802$var$scratchFirstCartesian);\n if (firstAxis !== \"east\" && firstAxis !== \"west\") (0, $bXwZF.default).multiplyByScalar($128fc127c88fc802$var$scratchFirstCartesian, sign, $128fc127c88fc802$var$scratchFirstCartesian);\n (0, $bXwZF.default).unpack($128fc127c88fc802$var$degeneratePositionLocalFrame[secondAxis], 0, $128fc127c88fc802$var$scratchSecondCartesian);\n if (secondAxis !== \"east\" && secondAxis !== \"west\") (0, $bXwZF.default).multiplyByScalar($128fc127c88fc802$var$scratchSecondCartesian, sign, $128fc127c88fc802$var$scratchSecondCartesian);\n (0, $bXwZF.default).unpack($128fc127c88fc802$var$degeneratePositionLocalFrame[thirdAxis], 0, $128fc127c88fc802$var$scratchThirdCartesian);\n if (thirdAxis !== \"east\" && thirdAxis !== \"west\") (0, $bXwZF.default).multiplyByScalar($128fc127c88fc802$var$scratchThirdCartesian, sign, $128fc127c88fc802$var$scratchThirdCartesian);\n } else {\n ellipsoid = (0, $8w8ZH.default)(ellipsoid, (0, $5237444a2d786ec9$export$2e2bcd8739ae039).default);\n ellipsoid.geodeticSurfaceNormal(origin, $128fc127c88fc802$var$scratchCalculateCartesian.up);\n const up = $128fc127c88fc802$var$scratchCalculateCartesian.up;\n const east = $128fc127c88fc802$var$scratchCalculateCartesian.east;\n east.x = -origin.y;\n east.y = origin.x;\n east.z = 0.0;\n (0, $bXwZF.default).normalize(east, $128fc127c88fc802$var$scratchCalculateCartesian.east);\n (0, $bXwZF.default).cross(up, east, $128fc127c88fc802$var$scratchCalculateCartesian.north);\n (0, $bXwZF.default).multiplyByScalar($128fc127c88fc802$var$scratchCalculateCartesian.up, -1, $128fc127c88fc802$var$scratchCalculateCartesian.down);\n (0, $bXwZF.default).multiplyByScalar($128fc127c88fc802$var$scratchCalculateCartesian.east, -1, $128fc127c88fc802$var$scratchCalculateCartesian.west);\n (0, $bXwZF.default).multiplyByScalar($128fc127c88fc802$var$scratchCalculateCartesian.north, -1, $128fc127c88fc802$var$scratchCalculateCartesian.south);\n $128fc127c88fc802$var$scratchFirstCartesian = $128fc127c88fc802$var$scratchCalculateCartesian[firstAxis];\n $128fc127c88fc802$var$scratchSecondCartesian = $128fc127c88fc802$var$scratchCalculateCartesian[secondAxis];\n $128fc127c88fc802$var$scratchThirdCartesian = $128fc127c88fc802$var$scratchCalculateCartesian[thirdAxis];\n }\n result[0] = $128fc127c88fc802$var$scratchFirstCartesian.x;\n result[1] = $128fc127c88fc802$var$scratchFirstCartesian.y;\n result[2] = $128fc127c88fc802$var$scratchFirstCartesian.z;\n result[3] = 0.0;\n result[4] = $128fc127c88fc802$var$scratchSecondCartesian.x;\n result[5] = $128fc127c88fc802$var$scratchSecondCartesian.y;\n result[6] = $128fc127c88fc802$var$scratchSecondCartesian.z;\n result[7] = 0.0;\n result[8] = $128fc127c88fc802$var$scratchThirdCartesian.x;\n result[9] = $128fc127c88fc802$var$scratchThirdCartesian.y;\n result[10] = $128fc127c88fc802$var$scratchThirdCartesian.z;\n result[11] = 0.0;\n result[12] = origin.x;\n result[13] = origin.y;\n result[14] = origin.z;\n result[15] = 1.0;\n return result;\n };\n $128fc127c88fc802$var$localFrameToFixedFrameCache[hashAxis] = resultat;\n }\n return resultat;\n};\n/**\n * Computes a 4x4 transformation matrix from a reference frame with an east-north-up axes\n * centered at the provided origin to the provided ellipsoid's fixed reference frame.\n * The local axes are defined as:\n * x
axis points in the local east direction.y
axis points in the local north direction.z
axis points in the direction of the ellipsoid surface normal which passes through the position.x
axis points in the local north direction.y
axis points in the local east direction.z
axis points in the opposite direction of the ellipsoid surface normal which passes through the position.x
axis points in the local north direction.y
axis points in the direction of the ellipsoid surface normal which passes through the position.z
axis points in the local east direction.x
axis points in the local north direction.y
axis points in the local west direction.z
axis points in the direction of the ellipsoid surface normal which passes through the position.(x / a)^2 + (y / b)^2 + (z / c)^2 = 1
. Primarily used\n * by Cesium to represent the shape of planetary bodies.\n *\n * Rather than constructing this object directly, one of the provided\n * constants is normally used.\n * @alias Ellipsoid\n * @constructor\n *\n * @param {number} [x=0] The radius in the x direction.\n * @param {number} [y=0] The radius in the y direction.\n * @param {number} [z=0] The radius in the z direction.\n *\n * @exception {DeveloperError} All radii components must be greater than or equal to zero.\n *\n * @see Ellipsoid.fromCartesian3\n * @see Ellipsoid.WGS84\n * @see Ellipsoid.UNIT_SPHERE\n */\nfunction Ellipsoid(x, y, z) {\n this._radii = undefined;\n this._radiiSquared = undefined;\n this._radiiToTheFourth = undefined;\n this._oneOverRadii = undefined;\n this._oneOverRadiiSquared = undefined;\n this._minimumRadius = undefined;\n this._maximumRadius = undefined;\n this._centerToleranceSquared = undefined;\n this._squaredXOverSquaredZ = undefined;\n\n initialize(this, x, y, z);\n}\n\nObject.defineProperties(Ellipsoid.prototype, {\n /**\n * Gets the radii of the ellipsoid.\n * @memberof Ellipsoid.prototype\n * @type {Cartesian3}\n * @readonly\n */\n radii: {\n get: function () {\n return this._radii;\n },\n },\n /**\n * Gets the squared radii of the ellipsoid.\n * @memberof Ellipsoid.prototype\n * @type {Cartesian3}\n * @readonly\n */\n radiiSquared: {\n get: function () {\n return this._radiiSquared;\n },\n },\n /**\n * Gets the radii of the ellipsoid raise to the fourth power.\n * @memberof Ellipsoid.prototype\n * @type {Cartesian3}\n * @readonly\n */\n radiiToTheFourth: {\n get: function () {\n return this._radiiToTheFourth;\n },\n },\n /**\n * Gets one over the radii of the ellipsoid.\n * @memberof Ellipsoid.prototype\n * @type {Cartesian3}\n * @readonly\n */\n oneOverRadii: {\n get: function () {\n return this._oneOverRadii;\n },\n },\n /**\n * Gets one over the squared radii of the ellipsoid.\n * @memberof Ellipsoid.prototype\n * @type {Cartesian3}\n * @readonly\n */\n oneOverRadiiSquared: {\n get: function () {\n return this._oneOverRadiiSquared;\n },\n },\n /**\n * Gets the minimum radius of the ellipsoid.\n * @memberof Ellipsoid.prototype\n * @type {number}\n * @readonly\n */\n minimumRadius: {\n get: function () {\n return this._minimumRadius;\n },\n },\n /**\n * Gets the maximum radius of the ellipsoid.\n * @memberof Ellipsoid.prototype\n * @type {number}\n * @readonly\n */\n maximumRadius: {\n get: function () {\n return this._maximumRadius;\n },\n },\n});\n\n/**\n * Duplicates an Ellipsoid instance.\n *\n * @param {Ellipsoid} ellipsoid The ellipsoid to duplicate.\n * @param {Ellipsoid} [result] The object onto which to store the result, or undefined if a new\n * instance should be created.\n * @returns {Ellipsoid} The cloned Ellipsoid. (Returns undefined if ellipsoid is undefined)\n */\nEllipsoid.clone = function (ellipsoid, result) {\n if (!defined(ellipsoid)) {\n return undefined;\n }\n const radii = ellipsoid._radii;\n\n if (!defined(result)) {\n return new Ellipsoid(radii.x, radii.y, radii.z);\n }\n\n Cartesian3.clone(radii, result._radii);\n Cartesian3.clone(ellipsoid._radiiSquared, result._radiiSquared);\n Cartesian3.clone(ellipsoid._radiiToTheFourth, result._radiiToTheFourth);\n Cartesian3.clone(ellipsoid._oneOverRadii, result._oneOverRadii);\n Cartesian3.clone(ellipsoid._oneOverRadiiSquared, result._oneOverRadiiSquared);\n result._minimumRadius = ellipsoid._minimumRadius;\n result._maximumRadius = ellipsoid._maximumRadius;\n result._centerToleranceSquared = ellipsoid._centerToleranceSquared;\n\n return result;\n};\n\n/**\n * Computes an Ellipsoid from a Cartesian specifying the radii in x, y, and z directions.\n *\n * @param {Cartesian3} [cartesian=Cartesian3.ZERO] The ellipsoid's radius in the x, y, and z directions.\n * @param {Ellipsoid} [result] The object onto which to store the result, or undefined if a new\n * instance should be created.\n * @returns {Ellipsoid} A new Ellipsoid instance.\n *\n * @exception {DeveloperError} All radii components must be greater than or equal to zero.\n *\n * @see Ellipsoid.WGS84\n * @see Ellipsoid.UNIT_SPHERE\n */\nEllipsoid.fromCartesian3 = function (cartesian, result) {\n if (!defined(result)) {\n result = new Ellipsoid();\n }\n\n if (!defined(cartesian)) {\n return result;\n }\n\n initialize(result, cartesian.x, cartesian.y, cartesian.z);\n return result;\n};\n\n/**\n * An Ellipsoid instance initialized to the WGS84 standard.\n *\n * @type {Ellipsoid}\n * @constant\n */\nEllipsoid.WGS84 = Object.freeze(\n new Ellipsoid(6378137.0, 6378137.0, 6356752.3142451793),\n);\n\n/**\n * An Ellipsoid instance initialized to radii of (1.0, 1.0, 1.0).\n *\n * @type {Ellipsoid}\n * @constant\n */\nEllipsoid.UNIT_SPHERE = Object.freeze(new Ellipsoid(1.0, 1.0, 1.0));\n\n/**\n * An Ellipsoid instance initialized to a sphere with the lunar radius.\n *\n * @type {Ellipsoid}\n * @constant\n */\nEllipsoid.MOON = Object.freeze(\n new Ellipsoid(\n CesiumMath.LUNAR_RADIUS,\n CesiumMath.LUNAR_RADIUS,\n CesiumMath.LUNAR_RADIUS,\n ),\n);\n\nEllipsoid._default = Ellipsoid.WGS84;\nObject.defineProperties(Ellipsoid, {\n /**\n * The default ellipsoid used when not otherwise specified.\n * @memberof Ellipsoid\n * @type {Ellipsoid}\n * @example\n * Cesium.Ellipsoid.default = Cesium.Ellipsoid.MOON;\n *\n * // Apollo 11 landing site\n * const position = Cesium.Cartesian3.fromRadians(\n * 0.67416,\n * 23.47315,\n * );\n */\n default: {\n get: function () {\n return Ellipsoid._default;\n },\n set: function (value) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"value\", value);\n //>>includeEnd('debug');\n\n Ellipsoid._default = value;\n Cartesian3._ellipsoidRadiiSquared = value.radiiSquared;\n Cartographic._ellipsoidOneOverRadii = value.oneOverRadii;\n Cartographic._ellipsoidOneOverRadiiSquared = value.oneOverRadiiSquared;\n Cartographic._ellipsoidCenterToleranceSquared =\n value._centerToleranceSquared;\n },\n },\n});\n\n/**\n * Duplicates an Ellipsoid instance.\n *\n * @param {Ellipsoid} [result] The object onto which to store the result, or undefined if a new\n * instance should be created.\n * @returns {Ellipsoid} The cloned Ellipsoid.\n */\nEllipsoid.prototype.clone = function (result) {\n return Ellipsoid.clone(this, result);\n};\n\n/**\n * The number of elements used to pack the object into an array.\n * @type {number}\n */\nEllipsoid.packedLength = Cartesian3.packedLength;\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {Ellipsoid} value The value to pack.\n * @param {number[]} array The array to pack into.\n * @param {number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {number[]} The array that was packed into\n */\nEllipsoid.pack = function (value, array, startingIndex) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"value\", value);\n Check.defined(\"array\", array);\n //>>includeEnd('debug');\n\n startingIndex = defaultValue(startingIndex, 0);\n\n Cartesian3.pack(value._radii, array, startingIndex);\n\n return array;\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {number[]} array The packed array.\n * @param {number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {Ellipsoid} [result] The object into which to store the result.\n * @returns {Ellipsoid} The modified result parameter or a new Ellipsoid instance if one was not provided.\n */\nEllipsoid.unpack = function (array, startingIndex, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.defined(\"array\", array);\n //>>includeEnd('debug');\n\n startingIndex = defaultValue(startingIndex, 0);\n\n const radii = Cartesian3.unpack(array, startingIndex);\n return Ellipsoid.fromCartesian3(radii, result);\n};\n\n/**\n * Computes the unit vector directed from the center of this ellipsoid toward the provided Cartesian position.\n * @function\n *\n * @param {Cartesian3} cartesian The Cartesian for which to to determine the geocentric normal.\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if none was provided.\n */\nEllipsoid.prototype.geocentricSurfaceNormal = Cartesian3.normalize;\n\n/**\n * Computes the normal of the plane tangent to the surface of the ellipsoid at the provided position.\n *\n * @param {Cartographic} cartographic The cartographic position for which to to determine the geodetic normal.\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if none was provided.\n */\nEllipsoid.prototype.geodeticSurfaceNormalCartographic = function (\n cartographic,\n result,\n) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"cartographic\", cartographic);\n //>>includeEnd('debug');\n\n const longitude = cartographic.longitude;\n const latitude = cartographic.latitude;\n const cosLatitude = Math.cos(latitude);\n\n const x = cosLatitude * Math.cos(longitude);\n const y = cosLatitude * Math.sin(longitude);\n const z = Math.sin(latitude);\n\n if (!defined(result)) {\n result = new Cartesian3();\n }\n result.x = x;\n result.y = y;\n result.z = z;\n return Cartesian3.normalize(result, result);\n};\n\n/**\n * Computes the normal of the plane tangent to the surface of the ellipsoid at the provided position.\n *\n * @param {Cartesian3} cartesian The Cartesian position for which to to determine the surface normal.\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if none was provided, or undefined if a normal cannot be found.\n */\nEllipsoid.prototype.geodeticSurfaceNormal = function (cartesian, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"cartesian\", cartesian);\n if (isNaN(cartesian.x) || isNaN(cartesian.y) || isNaN(cartesian.z)) {\n throw new DeveloperError(\"cartesian has a NaN component\");\n }\n //>>includeEnd('debug');\n if (\n Cartesian3.equalsEpsilon(cartesian, Cartesian3.ZERO, CesiumMath.EPSILON14)\n ) {\n return undefined;\n }\n if (!defined(result)) {\n result = new Cartesian3();\n }\n result = Cartesian3.multiplyComponents(\n cartesian,\n this._oneOverRadiiSquared,\n result,\n );\n return Cartesian3.normalize(result, result);\n};\n\nconst cartographicToCartesianNormal = new Cartesian3();\nconst cartographicToCartesianK = new Cartesian3();\n\n/**\n * Converts the provided cartographic to Cartesian representation.\n *\n * @param {Cartographic} cartographic The cartographic position.\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if none was provided.\n *\n * @example\n * //Create a Cartographic and determine it's Cartesian representation on a WGS84 ellipsoid.\n * const position = new Cesium.Cartographic(Cesium.Math.toRadians(21), Cesium.Math.toRadians(78), 5000);\n * const cartesianPosition = Cesium.Ellipsoid.WGS84.cartographicToCartesian(position);\n */\nEllipsoid.prototype.cartographicToCartesian = function (cartographic, result) {\n //`cartographic is required` is thrown from geodeticSurfaceNormalCartographic.\n const n = cartographicToCartesianNormal;\n const k = cartographicToCartesianK;\n this.geodeticSurfaceNormalCartographic(cartographic, n);\n Cartesian3.multiplyComponents(this._radiiSquared, n, k);\n const gamma = Math.sqrt(Cartesian3.dot(n, k));\n Cartesian3.divideByScalar(k, gamma, k);\n Cartesian3.multiplyByScalar(n, cartographic.height, n);\n\n if (!defined(result)) {\n result = new Cartesian3();\n }\n return Cartesian3.add(k, n, result);\n};\n\n/**\n * Converts the provided array of cartographics to an array of Cartesians.\n *\n * @param {Cartographic[]} cartographics An array of cartographic positions.\n * @param {Cartesian3[]} [result] The object onto which to store the result.\n * @returns {Cartesian3[]} The modified result parameter or a new Array instance if none was provided.\n *\n * @example\n * //Convert an array of Cartographics and determine their Cartesian representation on a WGS84 ellipsoid.\n * const positions = [new Cesium.Cartographic(Cesium.Math.toRadians(21), Cesium.Math.toRadians(78), 0),\n * new Cesium.Cartographic(Cesium.Math.toRadians(21.321), Cesium.Math.toRadians(78.123), 100),\n * new Cesium.Cartographic(Cesium.Math.toRadians(21.645), Cesium.Math.toRadians(78.456), 250)];\n * const cartesianPositions = Cesium.Ellipsoid.WGS84.cartographicArrayToCartesianArray(positions);\n */\nEllipsoid.prototype.cartographicArrayToCartesianArray = function (\n cartographics,\n result,\n) {\n //>>includeStart('debug', pragmas.debug);\n Check.defined(\"cartographics\", cartographics);\n //>>includeEnd('debug')\n\n const length = cartographics.length;\n if (!defined(result)) {\n result = new Array(length);\n } else {\n result.length = length;\n }\n for (let i = 0; i < length; i++) {\n result[i] = this.cartographicToCartesian(cartographics[i], result[i]);\n }\n return result;\n};\n\nconst cartesianToCartographicN = new Cartesian3();\nconst cartesianToCartographicP = new Cartesian3();\nconst cartesianToCartographicH = new Cartesian3();\n\n/**\n * Converts the provided cartesian to cartographic representation.\n * The cartesian is undefined at the center of the ellipsoid.\n *\n * @param {Cartesian3} cartesian The Cartesian position to convert to cartographic representation.\n * @param {Cartographic} [result] The object onto which to store the result.\n * @returns {Cartographic} The modified result parameter, new Cartographic instance if none was provided, or undefined if the cartesian is at the center of the ellipsoid.\n *\n * @example\n * //Create a Cartesian and determine it's Cartographic representation on a WGS84 ellipsoid.\n * const position = new Cesium.Cartesian3(17832.12, 83234.52, 952313.73);\n * const cartographicPosition = Cesium.Ellipsoid.WGS84.cartesianToCartographic(position);\n */\nEllipsoid.prototype.cartesianToCartographic = function (cartesian, result) {\n //`cartesian is required.` is thrown from scaleToGeodeticSurface\n const p = this.scaleToGeodeticSurface(cartesian, cartesianToCartographicP);\n\n if (!defined(p)) {\n return undefined;\n }\n\n const n = this.geodeticSurfaceNormal(p, cartesianToCartographicN);\n const h = Cartesian3.subtract(cartesian, p, cartesianToCartographicH);\n\n const longitude = Math.atan2(n.y, n.x);\n const latitude = Math.asin(n.z);\n const height =\n CesiumMath.sign(Cartesian3.dot(h, cartesian)) * Cartesian3.magnitude(h);\n\n if (!defined(result)) {\n return new Cartographic(longitude, latitude, height);\n }\n result.longitude = longitude;\n result.latitude = latitude;\n result.height = height;\n return result;\n};\n\n/**\n * Converts the provided array of cartesians to an array of cartographics.\n *\n * @param {Cartesian3[]} cartesians An array of Cartesian positions.\n * @param {Cartographic[]} [result] The object onto which to store the result.\n * @returns {Cartographic[]} The modified result parameter or a new Array instance if none was provided.\n *\n * @example\n * //Create an array of Cartesians and determine their Cartographic representation on a WGS84 ellipsoid.\n * const positions = [new Cesium.Cartesian3(17832.12, 83234.52, 952313.73),\n * new Cesium.Cartesian3(17832.13, 83234.53, 952313.73),\n * new Cesium.Cartesian3(17832.14, 83234.54, 952313.73)]\n * const cartographicPositions = Cesium.Ellipsoid.WGS84.cartesianArrayToCartographicArray(positions);\n */\nEllipsoid.prototype.cartesianArrayToCartographicArray = function (\n cartesians,\n result,\n) {\n //>>includeStart('debug', pragmas.debug);\n Check.defined(\"cartesians\", cartesians);\n //>>includeEnd('debug');\n\n const length = cartesians.length;\n if (!defined(result)) {\n result = new Array(length);\n } else {\n result.length = length;\n }\n for (let i = 0; i < length; ++i) {\n result[i] = this.cartesianToCartographic(cartesians[i], result[i]);\n }\n return result;\n};\n\n/**\n * Scales the provided Cartesian position along the geodetic surface normal\n * so that it is on the surface of this ellipsoid. If the position is\n * at the center of the ellipsoid, this function returns undefined.\n *\n * @param {Cartesian3} cartesian The Cartesian position to scale.\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter, a new Cartesian3 instance if none was provided, or undefined if the position is at the center.\n */\nEllipsoid.prototype.scaleToGeodeticSurface = function (cartesian, result) {\n return scaleToGeodeticSurface(\n cartesian,\n this._oneOverRadii,\n this._oneOverRadiiSquared,\n this._centerToleranceSquared,\n result,\n );\n};\n\n/**\n * Scales the provided Cartesian position along the geocentric surface normal\n * so that it is on the surface of this ellipsoid.\n *\n * @param {Cartesian3} cartesian The Cartesian position to scale.\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if none was provided.\n */\nEllipsoid.prototype.scaleToGeocentricSurface = function (cartesian, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"cartesian\", cartesian);\n //>>includeEnd('debug');\n\n if (!defined(result)) {\n result = new Cartesian3();\n }\n\n const positionX = cartesian.x;\n const positionY = cartesian.y;\n const positionZ = cartesian.z;\n const oneOverRadiiSquared = this._oneOverRadiiSquared;\n\n const beta =\n 1.0 /\n Math.sqrt(\n positionX * positionX * oneOverRadiiSquared.x +\n positionY * positionY * oneOverRadiiSquared.y +\n positionZ * positionZ * oneOverRadiiSquared.z,\n );\n\n return Cartesian3.multiplyByScalar(cartesian, beta, result);\n};\n\n/**\n * Transforms a Cartesian X, Y, Z position to the ellipsoid-scaled space by multiplying\n * its components by the result of {@link Ellipsoid#oneOverRadii}.\n *\n * @param {Cartesian3} position The position to transform.\n * @param {Cartesian3} [result] The position to which to copy the result, or undefined to create and\n * return a new instance.\n * @returns {Cartesian3} The position expressed in the scaled space. The returned instance is the\n * one passed as the result parameter if it is not undefined, or a new instance of it is.\n */\nEllipsoid.prototype.transformPositionToScaledSpace = function (\n position,\n result,\n) {\n if (!defined(result)) {\n result = new Cartesian3();\n }\n\n return Cartesian3.multiplyComponents(position, this._oneOverRadii, result);\n};\n\n/**\n * Transforms a Cartesian X, Y, Z position from the ellipsoid-scaled space by multiplying\n * its components by the result of {@link Ellipsoid#radii}.\n *\n * @param {Cartesian3} position The position to transform.\n * @param {Cartesian3} [result] The position to which to copy the result, or undefined to create and\n * return a new instance.\n * @returns {Cartesian3} The position expressed in the unscaled space. The returned instance is the\n * one passed as the result parameter if it is not undefined, or a new instance of it is.\n */\nEllipsoid.prototype.transformPositionFromScaledSpace = function (\n position,\n result,\n) {\n if (!defined(result)) {\n result = new Cartesian3();\n }\n\n return Cartesian3.multiplyComponents(position, this._radii, result);\n};\n\n/**\n * Compares this Ellipsoid against the provided Ellipsoid componentwise and returns\n * true
if they are equal, false
otherwise.\n *\n * @param {Ellipsoid} [right] The other Ellipsoid.\n * @returns {boolean} true
if they are equal, false
otherwise.\n */\nEllipsoid.prototype.equals = function (right) {\n return (\n this === right ||\n (defined(right) && Cartesian3.equals(this._radii, right._radii))\n );\n};\n\n/**\n * Creates a string representing this Ellipsoid in the format '(radii.x, radii.y, radii.z)'.\n *\n * @returns {string} A string representing this ellipsoid in the format '(radii.x, radii.y, radii.z)'.\n */\nEllipsoid.prototype.toString = function () {\n return this._radii.toString();\n};\n\n/**\n * Computes a point which is the intersection of the surface normal with the z-axis.\n *\n * @param {Cartesian3} position the position. must be on the surface of the ellipsoid.\n * @param {number} [buffer = 0.0] A buffer to subtract from the ellipsoid size when checking if the point is inside the ellipsoid.\n * 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.\n * In WGS84 datum, intersection point is at max z = +-42841.31151331382 (0.673% of z-axis).\n * Intersection point could be outside the ellipsoid if the ratio of MajorAxis / AxisOfRotation is bigger than the square root of 2\n * @param {Cartesian3} [result] The cartesian to which to copy the result, or undefined to create and\n * return a new instance.\n * @returns {Cartesian3 | undefined} the intersection point if it's inside the ellipsoid, undefined otherwise\n *\n * @exception {DeveloperError} position is required.\n * @exception {DeveloperError} Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y).\n * @exception {DeveloperError} Ellipsoid.radii.z must be greater than 0.\n */\nEllipsoid.prototype.getSurfaceNormalIntersectionWithZAxis = function (\n position,\n buffer,\n result,\n) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"position\", position);\n\n if (\n !CesiumMath.equalsEpsilon(\n this._radii.x,\n this._radii.y,\n CesiumMath.EPSILON15,\n )\n ) {\n throw new DeveloperError(\n \"Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)\",\n );\n }\n\n Check.typeOf.number.greaterThan(\"Ellipsoid.radii.z\", this._radii.z, 0);\n //>>includeEnd('debug');\n\n buffer = defaultValue(buffer, 0.0);\n\n const squaredXOverSquaredZ = this._squaredXOverSquaredZ;\n\n if (!defined(result)) {\n result = new Cartesian3();\n }\n\n result.x = 0.0;\n result.y = 0.0;\n result.z = position.z * (1 - squaredXOverSquaredZ);\n\n if (Math.abs(result.z) >= this._radii.z - buffer) {\n return undefined;\n }\n\n return result;\n};\n\nconst scratchEndpoint = new Cartesian3();\n\n/**\n * Computes the ellipsoid curvatures at a given position on the surface.\n *\n * @param {Cartesian3} surfacePosition The position on the ellipsoid surface where curvatures will be calculated.\n * @param {Cartesian2} [result] The cartesian to which to copy the result, or undefined to create and return a new instance.\n * @returns {Cartesian2} The local curvature of the ellipsoid surface at the provided position, in east and north directions.\n *\n * @exception {DeveloperError} position is required.\n */\nEllipsoid.prototype.getLocalCurvature = function (surfacePosition, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"surfacePosition\", surfacePosition);\n //>>includeEnd('debug');\n\n if (!defined(result)) {\n result = new Cartesian2();\n }\n\n const primeVerticalEndpoint = this.getSurfaceNormalIntersectionWithZAxis(\n surfacePosition,\n 0.0,\n scratchEndpoint,\n );\n const primeVerticalRadius = Cartesian3.distance(\n surfacePosition,\n primeVerticalEndpoint,\n );\n // meridional radius = (1 - e^2) * primeVerticalRadius^3 / a^2\n // where 1 - e^2 = b^2 / a^2,\n // so meridional = b^2 * primeVerticalRadius^3 / a^4\n // = (b * primeVerticalRadius / a^2)^2 * primeVertical\n const radiusRatio =\n (this.minimumRadius * primeVerticalRadius) / this.maximumRadius ** 2;\n const meridionalRadius = primeVerticalRadius * radiusRatio ** 2;\n\n return Cartesian2.fromElements(\n 1.0 / primeVerticalRadius,\n 1.0 / meridionalRadius,\n result,\n );\n};\n\nconst abscissas = [\n 0.14887433898163, 0.43339539412925, 0.67940956829902, 0.86506336668898,\n 0.97390652851717, 0.0,\n];\nconst weights = [\n 0.29552422471475, 0.26926671930999, 0.21908636251598, 0.14945134915058,\n 0.066671344308684, 0.0,\n];\n\n/**\n * Compute the 10th order Gauss-Legendre Quadrature of the given definite integral.\n *\n * @param {number} a The lower bound for the integration.\n * @param {number} b The upper bound for the integration.\n * @param {Ellipsoid~RealValuedScalarFunction} func The function to integrate.\n * @returns {number} The value of the integral of the given function over the given domain.\n *\n * @private\n */\nfunction gaussLegendreQuadrature(a, b, func) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.number(\"a\", a);\n Check.typeOf.number(\"b\", b);\n Check.typeOf.func(\"func\", func);\n //>>includeEnd('debug');\n\n // The range is half of the normal range since the five weights add to one (ten weights add to two).\n // The values of the abscissas are multiplied by two to account for this.\n const xMean = 0.5 * (b + a);\n const xRange = 0.5 * (b - a);\n\n let sum = 0.0;\n for (let i = 0; i < 5; i++) {\n const dx = xRange * abscissas[i];\n sum += weights[i] * (func(xMean + dx) + func(xMean - dx));\n }\n\n // Scale the sum to the range of x.\n sum *= xRange;\n return sum;\n}\n\n/**\n * A real valued scalar function.\n * @callback Ellipsoid~RealValuedScalarFunction\n *\n * @param {number} x The value used to evaluate the function.\n * @returns {number} The value of the function at x.\n *\n * @private\n */\n\n/**\n * Computes an approximation of the surface area of a rectangle on the surface of an ellipsoid using\n * Gauss-Legendre 10th order quadrature.\n *\n * @param {Rectangle} rectangle The rectangle used for computing the surface area.\n * @returns {number} The approximate area of the rectangle on the surface of this ellipsoid.\n */\nEllipsoid.prototype.surfaceArea = function (rectangle) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"rectangle\", rectangle);\n //>>includeEnd('debug');\n const minLongitude = rectangle.west;\n let maxLongitude = rectangle.east;\n const minLatitude = rectangle.south;\n const maxLatitude = rectangle.north;\n\n while (maxLongitude < minLongitude) {\n maxLongitude += CesiumMath.TWO_PI;\n }\n\n const radiiSquared = this._radiiSquared;\n const a2 = radiiSquared.x;\n const b2 = radiiSquared.y;\n const c2 = radiiSquared.z;\n const a2b2 = a2 * b2;\n return gaussLegendreQuadrature(minLatitude, maxLatitude, function (lat) {\n // phi represents the angle measured from the north pole\n // sin(phi) = sin(pi / 2 - lat) = cos(lat), cos(phi) is similar\n const sinPhi = Math.cos(lat);\n const cosPhi = Math.sin(lat);\n return (\n Math.cos(lat) *\n gaussLegendreQuadrature(minLongitude, maxLongitude, function (lon) {\n const cosTheta = Math.cos(lon);\n const sinTheta = Math.sin(lon);\n return Math.sqrt(\n a2b2 * cosPhi * cosPhi +\n c2 *\n (b2 * cosTheta * cosTheta + a2 * sinTheta * sinTheta) *\n sinPhi *\n sinPhi,\n );\n })\n );\n });\n};\n\nexport default Ellipsoid;\n","import Cartesian3 from \"./Cartesian3.js\";\nimport Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport CesiumMath from \"./Math.js\";\nimport scaleToGeodeticSurface from \"./scaleToGeodeticSurface.js\";\n\n/**\n * A position defined by longitude, latitude, and height.\n * @alias Cartographic\n * @constructor\n *\n * @param {number} [longitude=0.0] The longitude, in radians.\n * @param {number} [latitude=0.0] The latitude, in radians.\n * @param {number} [height=0.0] The height, in meters, above the ellipsoid.\n *\n * @see Ellipsoid\n */\nfunction Cartographic(longitude, latitude, height) {\n /**\n * The longitude, in radians.\n * @type {number}\n * @default 0.0\n */\n this.longitude = defaultValue(longitude, 0.0);\n\n /**\n * The latitude, in radians.\n * @type {number}\n * @default 0.0\n */\n this.latitude = defaultValue(latitude, 0.0);\n\n /**\n * The height, in meters, above the ellipsoid.\n * @type {number}\n * @default 0.0\n */\n this.height = defaultValue(height, 0.0);\n}\n\n/**\n * Creates a new Cartographic instance from longitude and latitude\n * specified in radians.\n *\n * @param {number} longitude The longitude, in radians.\n * @param {number} latitude The latitude, in radians.\n * @param {number} [height=0.0] The height, in meters, above the ellipsoid.\n * @param {Cartographic} [result] The object onto which to store the result.\n * @returns {Cartographic} The modified result parameter or a new Cartographic instance if one was not provided.\n */\nCartographic.fromRadians = function (longitude, latitude, height, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.number(\"longitude\", longitude);\n Check.typeOf.number(\"latitude\", latitude);\n //>>includeEnd('debug');\n\n height = defaultValue(height, 0.0);\n\n if (!defined(result)) {\n return new Cartographic(longitude, latitude, height);\n }\n\n result.longitude = longitude;\n result.latitude = latitude;\n result.height = height;\n return result;\n};\n\n/**\n * Creates a new Cartographic instance from longitude and latitude\n * specified in degrees. The values in the resulting object will\n * be in radians.\n *\n * @param {number} longitude The longitude, in degrees.\n * @param {number} latitude The latitude, in degrees.\n * @param {number} [height=0.0] The height, in meters, above the ellipsoid.\n * @param {Cartographic} [result] The object onto which to store the result.\n * @returns {Cartographic} The modified result parameter or a new Cartographic instance if one was not provided.\n */\nCartographic.fromDegrees = function (longitude, latitude, height, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.number(\"longitude\", longitude);\n Check.typeOf.number(\"latitude\", latitude);\n //>>includeEnd('debug');\n\n longitude = CesiumMath.toRadians(longitude);\n latitude = CesiumMath.toRadians(latitude);\n\n return Cartographic.fromRadians(longitude, latitude, height, result);\n};\n\nconst cartesianToCartographicN = new Cartesian3();\nconst cartesianToCartographicP = new Cartesian3();\nconst cartesianToCartographicH = new Cartesian3();\n\n// To avoid circular dependencies, these are set by Ellipsoid when Ellipsoid.default is set.\nCartographic._ellipsoidOneOverRadii = new Cartesian3(\n 1.0 / 6378137.0,\n 1.0 / 6378137.0,\n 1.0 / 6356752.3142451793,\n);\nCartographic._ellipsoidOneOverRadiiSquared = new Cartesian3(\n 1.0 / (6378137.0 * 6378137.0),\n 1.0 / (6378137.0 * 6378137.0),\n 1.0 / (6356752.3142451793 * 6356752.3142451793),\n);\nCartographic._ellipsoidCenterToleranceSquared = CesiumMath.EPSILON1;\n\n/**\n * Creates a new Cartographic instance from a Cartesian position. The values in the\n * resulting object will be in radians.\n *\n * @param {Cartesian3} cartesian The Cartesian position to convert to cartographic representation.\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.default] The ellipsoid on which the position lies.\n * @param {Cartographic} [result] The object onto which to store the result.\n * @returns {Cartographic} The modified result parameter, new Cartographic instance if none was provided, or undefined if the cartesian is at the center of the ellipsoid.\n */\nCartographic.fromCartesian = function (cartesian, ellipsoid, result) {\n const oneOverRadii = defined(ellipsoid)\n ? ellipsoid.oneOverRadii\n : Cartographic._ellipsoidOneOverRadii;\n const oneOverRadiiSquared = defined(ellipsoid)\n ? ellipsoid.oneOverRadiiSquared\n : Cartographic._ellipsoidOneOverRadiiSquared;\n const centerToleranceSquared = defined(ellipsoid)\n ? ellipsoid._centerToleranceSquared\n : Cartographic._ellipsoidCenterToleranceSquared;\n\n //`cartesian is required.` is thrown from scaleToGeodeticSurface\n const p = scaleToGeodeticSurface(\n cartesian,\n oneOverRadii,\n oneOverRadiiSquared,\n centerToleranceSquared,\n cartesianToCartographicP,\n );\n\n if (!defined(p)) {\n return undefined;\n }\n\n let n = Cartesian3.multiplyComponents(\n p,\n oneOverRadiiSquared,\n cartesianToCartographicN,\n );\n n = Cartesian3.normalize(n, n);\n\n const h = Cartesian3.subtract(cartesian, p, cartesianToCartographicH);\n\n const longitude = Math.atan2(n.y, n.x);\n const latitude = Math.asin(n.z);\n const height =\n CesiumMath.sign(Cartesian3.dot(h, cartesian)) * Cartesian3.magnitude(h);\n\n if (!defined(result)) {\n return new Cartographic(longitude, latitude, height);\n }\n result.longitude = longitude;\n result.latitude = latitude;\n result.height = height;\n return result;\n};\n\n/**\n * Creates a new Cartesian3 instance from a Cartographic input. The values in the inputted\n * object should be in radians.\n *\n * @param {Cartographic} cartographic Input to be converted into a Cartesian3 output.\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.default] The ellipsoid on which the position lies.\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {Cartesian3} The position\n */\nCartographic.toCartesian = function (cartographic, ellipsoid, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.defined(\"cartographic\", cartographic);\n //>>includeEnd('debug');\n\n return Cartesian3.fromRadians(\n cartographic.longitude,\n cartographic.latitude,\n cartographic.height,\n ellipsoid,\n result,\n );\n};\n\n/**\n * Duplicates a Cartographic instance.\n *\n * @param {Cartographic} cartographic The cartographic to duplicate.\n * @param {Cartographic} [result] The object onto which to store the result.\n * @returns {Cartographic} The modified result parameter or a new Cartographic instance if one was not provided. (Returns undefined if cartographic is undefined)\n */\nCartographic.clone = function (cartographic, result) {\n if (!defined(cartographic)) {\n return undefined;\n }\n if (!defined(result)) {\n return new Cartographic(\n cartographic.longitude,\n cartographic.latitude,\n cartographic.height,\n );\n }\n result.longitude = cartographic.longitude;\n result.latitude = cartographic.latitude;\n result.height = cartographic.height;\n return result;\n};\n\n/**\n * Compares the provided cartographics componentwise and returns\n * true
if they are equal, false
otherwise.\n *\n * @param {Cartographic} [left] The first cartographic.\n * @param {Cartographic} [right] The second cartographic.\n * @returns {boolean} true
if left and right are equal, false
otherwise.\n */\nCartographic.equals = function (left, right) {\n return (\n left === right ||\n (defined(left) &&\n defined(right) &&\n left.longitude === right.longitude &&\n left.latitude === right.latitude &&\n left.height === right.height)\n );\n};\n\n/**\n * Compares the provided cartographics componentwise and returns\n * true
if they are within the provided epsilon,\n * false
otherwise.\n *\n * @param {Cartographic} [left] The first cartographic.\n * @param {Cartographic} [right] The second cartographic.\n * @param {number} [epsilon=0] The epsilon to use for equality testing.\n * @returns {boolean} true
if left and right are within the provided epsilon, false
otherwise.\n */\nCartographic.equalsEpsilon = function (left, right, epsilon) {\n epsilon = defaultValue(epsilon, 0);\n\n return (\n left === right ||\n (defined(left) &&\n defined(right) &&\n Math.abs(left.longitude - right.longitude) <= epsilon &&\n Math.abs(left.latitude - right.latitude) <= epsilon &&\n Math.abs(left.height - right.height) <= epsilon)\n );\n};\n\n/**\n * An immutable Cartographic instance initialized to (0.0, 0.0, 0.0).\n *\n * @type {Cartographic}\n * @constant\n */\nCartographic.ZERO = Object.freeze(new Cartographic(0.0, 0.0, 0.0));\n\n/**\n * Duplicates this instance.\n *\n * @param {Cartographic} [result] The object onto which to store the result.\n * @returns {Cartographic} The modified result parameter or a new Cartographic instance if one was not provided.\n */\nCartographic.prototype.clone = function (result) {\n return Cartographic.clone(this, result);\n};\n\n/**\n * Compares the provided against this cartographic componentwise and returns\n * true
if they are equal, false
otherwise.\n *\n * @param {Cartographic} [right] The second cartographic.\n * @returns {boolean} true
if left and right are equal, false
otherwise.\n */\nCartographic.prototype.equals = function (right) {\n return Cartographic.equals(this, right);\n};\n\n/**\n * Compares the provided against this cartographic componentwise and returns\n * true
if they are within the provided epsilon,\n * false
otherwise.\n *\n * @param {Cartographic} [right] The second cartographic.\n * @param {number} [epsilon=0] The epsilon to use for equality testing.\n * @returns {boolean} true
if left and right are within the provided epsilon, false
otherwise.\n */\nCartographic.prototype.equalsEpsilon = function (right, epsilon) {\n return Cartographic.equalsEpsilon(this, right, epsilon);\n};\n\n/**\n * Creates a string representing this cartographic in the format '(longitude, latitude, height)'.\n *\n * @returns {string} A string representing the provided cartographic in the format '(longitude, latitude, height)'.\n */\nCartographic.prototype.toString = function () {\n return `(${this.longitude}, ${this.latitude}, ${this.height})`;\n};\nexport default Cartographic;\n","import Cartesian3 from \"./Cartesian3.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport CesiumMath from \"./Math.js\";\n\nconst scaleToGeodeticSurfaceIntersection = new Cartesian3();\nconst scaleToGeodeticSurfaceGradient = new Cartesian3();\n\n/**\n * Scales the provided Cartesian position along the geodetic surface normal\n * so that it is on the surface of this ellipsoid. If the position is\n * at the center of the ellipsoid, this function returns undefined.\n *\n * @param {Cartesian3} cartesian The Cartesian position to scale.\n * @param {Cartesian3} oneOverRadii One over radii of the ellipsoid.\n * @param {Cartesian3} oneOverRadiiSquared One over radii squared of the ellipsoid.\n * @param {number} centerToleranceSquared Tolerance for closeness to the center.\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter, a new Cartesian3 instance if none was provided, or undefined if the position is at the center.\n *\n * @function scaleToGeodeticSurface\n *\n * @private\n */\nfunction scaleToGeodeticSurface(\n cartesian,\n oneOverRadii,\n oneOverRadiiSquared,\n centerToleranceSquared,\n result,\n) {\n //>>includeStart('debug', pragmas.debug);\n if (!defined(cartesian)) {\n throw new DeveloperError(\"cartesian is required.\");\n }\n if (!defined(oneOverRadii)) {\n throw new DeveloperError(\"oneOverRadii is required.\");\n }\n if (!defined(oneOverRadiiSquared)) {\n throw new DeveloperError(\"oneOverRadiiSquared is required.\");\n }\n if (!defined(centerToleranceSquared)) {\n throw new DeveloperError(\"centerToleranceSquared is required.\");\n }\n //>>includeEnd('debug');\n\n const positionX = cartesian.x;\n const positionY = cartesian.y;\n const positionZ = cartesian.z;\n\n const oneOverRadiiX = oneOverRadii.x;\n const oneOverRadiiY = oneOverRadii.y;\n const oneOverRadiiZ = oneOverRadii.z;\n\n const x2 = positionX * positionX * oneOverRadiiX * oneOverRadiiX;\n const y2 = positionY * positionY * oneOverRadiiY * oneOverRadiiY;\n const z2 = positionZ * positionZ * oneOverRadiiZ * oneOverRadiiZ;\n\n // Compute the squared ellipsoid norm.\n const squaredNorm = x2 + y2 + z2;\n const ratio = Math.sqrt(1.0 / squaredNorm);\n\n // As an initial approximation, assume that the radial intersection is the projection point.\n const intersection = Cartesian3.multiplyByScalar(\n cartesian,\n ratio,\n scaleToGeodeticSurfaceIntersection,\n );\n\n // If the position is near the center, the iteration will not converge.\n if (squaredNorm < centerToleranceSquared) {\n return !isFinite(ratio)\n ? undefined\n : Cartesian3.clone(intersection, result);\n }\n\n const oneOverRadiiSquaredX = oneOverRadiiSquared.x;\n const oneOverRadiiSquaredY = oneOverRadiiSquared.y;\n const oneOverRadiiSquaredZ = oneOverRadiiSquared.z;\n\n // Use the gradient at the intersection point in place of the true unit normal.\n // The difference in magnitude will be absorbed in the multiplier.\n const gradient = scaleToGeodeticSurfaceGradient;\n gradient.x = intersection.x * oneOverRadiiSquaredX * 2.0;\n gradient.y = intersection.y * oneOverRadiiSquaredY * 2.0;\n gradient.z = intersection.z * oneOverRadiiSquaredZ * 2.0;\n\n // Compute the initial guess at the normal vector multiplier, lambda.\n let lambda =\n ((1.0 - ratio) * Cartesian3.magnitude(cartesian)) /\n (0.5 * Cartesian3.magnitude(gradient));\n let correction = 0.0;\n\n let func;\n let denominator;\n let xMultiplier;\n let yMultiplier;\n let zMultiplier;\n let xMultiplier2;\n let yMultiplier2;\n let zMultiplier2;\n let xMultiplier3;\n let yMultiplier3;\n let zMultiplier3;\n\n do {\n lambda -= correction;\n\n xMultiplier = 1.0 / (1.0 + lambda * oneOverRadiiSquaredX);\n yMultiplier = 1.0 / (1.0 + lambda * oneOverRadiiSquaredY);\n zMultiplier = 1.0 / (1.0 + lambda * oneOverRadiiSquaredZ);\n\n xMultiplier2 = xMultiplier * xMultiplier;\n yMultiplier2 = yMultiplier * yMultiplier;\n zMultiplier2 = zMultiplier * zMultiplier;\n\n xMultiplier3 = xMultiplier2 * xMultiplier;\n yMultiplier3 = yMultiplier2 * yMultiplier;\n zMultiplier3 = zMultiplier2 * zMultiplier;\n\n func = x2 * xMultiplier2 + y2 * yMultiplier2 + z2 * zMultiplier2 - 1.0;\n\n // \"denominator\" here refers to the use of this expression in the velocity and acceleration\n // computations in the sections to follow.\n denominator =\n x2 * xMultiplier3 * oneOverRadiiSquaredX +\n y2 * yMultiplier3 * oneOverRadiiSquaredY +\n z2 * zMultiplier3 * oneOverRadiiSquaredZ;\n\n const derivative = -2.0 * denominator;\n\n correction = func / derivative;\n } while (Math.abs(func) > CesiumMath.EPSILON12);\n\n if (!defined(result)) {\n return new Cartesian3(\n positionX * xMultiplier,\n positionY * yMultiplier,\n positionZ * zMultiplier,\n );\n }\n result.x = positionX * xMultiplier;\n result.y = positionY * yMultiplier;\n result.z = positionZ * zMultiplier;\n return result;\n}\nexport default scaleToGeodeticSurface;\n","import Cartesian3 from \"./Cartesian3.js\";\nimport Cartesian4 from \"./Cartesian4.js\";\nimport Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport CesiumMath from \"./Math.js\";\nimport Matrix3 from \"./Matrix3.js\";\nimport RuntimeError from \"./RuntimeError.js\";\n\n/**\n * A 4x4 matrix, indexable as a column-major order array.\n * Constructor parameters are in row-major order for code readability.\n * @alias Matrix4\n * @constructor\n * @implements {ArrayLike[0.0, 0.0, 0.0, 1.0]
)\n * by a 3x3 rotation matrix. This is an optimization\n * for Matrix4.multiply(m, Matrix4.fromRotationTranslation(rotation), m);
with less allocations and arithmetic operations.\n *\n * @param {Matrix4} matrix The matrix on the left-hand side.\n * @param {Matrix3} rotation The 3x3 rotation matrix on the right-hand side.\n * @param {Matrix4} result The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter.\n *\n * @example\n * // Instead of Cesium.Matrix4.multiply(m, Cesium.Matrix4.fromRotationTranslation(rotation), m);\n * Cesium.Matrix4.multiplyByMatrix3(m, rotation, m);\n */\nMatrix4.multiplyByMatrix3 = function (matrix, rotation, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"matrix\", matrix);\n Check.typeOf.object(\"rotation\", rotation);\n Check.typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n\n const left0 = matrix[0];\n const left1 = matrix[1];\n const left2 = matrix[2];\n const left4 = matrix[4];\n const left5 = matrix[5];\n const left6 = matrix[6];\n const left8 = matrix[8];\n const left9 = matrix[9];\n const left10 = matrix[10];\n\n const right0 = rotation[0];\n const right1 = rotation[1];\n const right2 = rotation[2];\n const right4 = rotation[3];\n const right5 = rotation[4];\n const right6 = rotation[5];\n const right8 = rotation[6];\n const right9 = rotation[7];\n const right10 = rotation[8];\n\n const column0Row0 = left0 * right0 + left4 * right1 + left8 * right2;\n const column0Row1 = left1 * right0 + left5 * right1 + left9 * right2;\n const column0Row2 = left2 * right0 + left6 * right1 + left10 * right2;\n\n const column1Row0 = left0 * right4 + left4 * right5 + left8 * right6;\n const column1Row1 = left1 * right4 + left5 * right5 + left9 * right6;\n const column1Row2 = left2 * right4 + left6 * right5 + left10 * right6;\n\n const column2Row0 = left0 * right8 + left4 * right9 + left8 * right10;\n const column2Row1 = left1 * right8 + left5 * right9 + left9 * right10;\n const column2Row2 = left2 * right8 + left6 * right9 + left10 * right10;\n\n result[0] = column0Row0;\n result[1] = column0Row1;\n result[2] = column0Row2;\n result[3] = 0.0;\n result[4] = column1Row0;\n result[5] = column1Row1;\n result[6] = column1Row2;\n result[7] = 0.0;\n result[8] = column2Row0;\n result[9] = column2Row1;\n result[10] = column2Row2;\n result[11] = 0.0;\n result[12] = matrix[12];\n result[13] = matrix[13];\n result[14] = matrix[14];\n result[15] = matrix[15];\n return result;\n};\n\n/**\n * Multiplies a transformation matrix (with a bottom row of [0.0, 0.0, 0.0, 1.0]
)\n * by an implicit translation matrix defined by a {@link Cartesian3}. This is an optimization\n * for Matrix4.multiply(m, Matrix4.fromTranslation(position), m);
with less allocations and arithmetic operations.\n *\n * @param {Matrix4} matrix The matrix on the left-hand side.\n * @param {Cartesian3} translation The translation on the right-hand side.\n * @param {Matrix4} result The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter.\n *\n * @example\n * // Instead of Cesium.Matrix4.multiply(m, Cesium.Matrix4.fromTranslation(position), m);\n * Cesium.Matrix4.multiplyByTranslation(m, position, m);\n */\nMatrix4.multiplyByTranslation = function (matrix, translation, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"matrix\", matrix);\n Check.typeOf.object(\"translation\", translation);\n Check.typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n\n const x = translation.x;\n const y = translation.y;\n const z = translation.z;\n\n const tx = x * matrix[0] + y * matrix[4] + z * matrix[8] + matrix[12];\n const ty = x * matrix[1] + y * matrix[5] + z * matrix[9] + matrix[13];\n const tz = x * matrix[2] + y * matrix[6] + z * matrix[10] + matrix[14];\n\n result[0] = matrix[0];\n result[1] = matrix[1];\n result[2] = matrix[2];\n result[3] = matrix[3];\n result[4] = matrix[4];\n result[5] = matrix[5];\n result[6] = matrix[6];\n result[7] = matrix[7];\n result[8] = matrix[8];\n result[9] = matrix[9];\n result[10] = matrix[10];\n result[11] = matrix[11];\n result[12] = tx;\n result[13] = ty;\n result[14] = tz;\n result[15] = matrix[15];\n return result;\n};\n\n/**\n * Multiplies an affine transformation matrix (with a bottom row of [0.0, 0.0, 0.0, 1.0]
)\n * by an implicit non-uniform scale matrix. This is an optimization\n * for Matrix4.multiply(m, Matrix4.fromUniformScale(scale), m);
, where\n * m
must be an affine matrix.\n * This function performs fewer allocations and arithmetic operations.\n *\n * @param {Matrix4} matrix The affine matrix on the left-hand side.\n * @param {Cartesian3} scale The non-uniform scale on the right-hand side.\n * @param {Matrix4} result The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter.\n *\n *\n * @example\n * // Instead of Cesium.Matrix4.multiply(m, Cesium.Matrix4.fromScale(scale), m);\n * Cesium.Matrix4.multiplyByScale(m, scale, m);\n *\n * @see Matrix4.multiplyByUniformScale\n * @see Matrix4.fromScale\n * @see Matrix4.fromUniformScale\n * @see Matrix4.setScale\n * @see Matrix4.setUniformScale\n * @see Matrix4.getScale\n */\nMatrix4.multiplyByScale = function (matrix, scale, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"matrix\", matrix);\n Check.typeOf.object(\"scale\", scale);\n Check.typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n\n const scaleX = scale.x;\n const scaleY = scale.y;\n const scaleZ = scale.z;\n\n // Faster than Cartesian3.equals\n if (scaleX === 1.0 && scaleY === 1.0 && scaleZ === 1.0) {\n return Matrix4.clone(matrix, result);\n }\n\n result[0] = scaleX * matrix[0];\n result[1] = scaleX * matrix[1];\n result[2] = scaleX * matrix[2];\n result[3] = matrix[3];\n\n result[4] = scaleY * matrix[4];\n result[5] = scaleY * matrix[5];\n result[6] = scaleY * matrix[6];\n result[7] = matrix[7];\n\n result[8] = scaleZ * matrix[8];\n result[9] = scaleZ * matrix[9];\n result[10] = scaleZ * matrix[10];\n result[11] = matrix[11];\n\n result[12] = matrix[12];\n result[13] = matrix[13];\n result[14] = matrix[14];\n result[15] = matrix[15];\n\n return result;\n};\n\n/**\n * Computes the product of a matrix times a uniform scale, as if the scale were a scale matrix.\n *\n * @param {Matrix4} matrix The matrix on the left-hand side.\n * @param {number} scale The uniform scale on the right-hand side.\n * @param {Matrix4} result The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter.\n *\n * @example\n * // Instead of Cesium.Matrix4.multiply(m, Cesium.Matrix4.fromUniformScale(scale), m);\n * Cesium.Matrix4.multiplyByUniformScale(m, scale, m);\n *\n * @see Matrix4.multiplyByScale\n * @see Matrix4.fromScale\n * @see Matrix4.fromUniformScale\n * @see Matrix4.setScale\n * @see Matrix4.setUniformScale\n * @see Matrix4.getScale\n */\nMatrix4.multiplyByUniformScale = function (matrix, scale, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"matrix\", matrix);\n Check.typeOf.number(\"scale\", scale);\n Check.typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n\n result[0] = matrix[0] * scale;\n result[1] = matrix[1] * scale;\n result[2] = matrix[2] * scale;\n result[3] = matrix[3];\n\n result[4] = matrix[4] * scale;\n result[5] = matrix[5] * scale;\n result[6] = matrix[6] * scale;\n result[7] = matrix[7];\n\n result[8] = matrix[8] * scale;\n result[9] = matrix[9] * scale;\n result[10] = matrix[10] * scale;\n result[11] = matrix[11];\n\n result[12] = matrix[12];\n result[13] = matrix[13];\n result[14] = matrix[14];\n result[15] = matrix[15];\n\n return result;\n};\n\n/**\n * Computes the product of a matrix and a column vector.\n *\n * @param {Matrix4} matrix The matrix.\n * @param {Cartesian4} cartesian The vector.\n * @param {Cartesian4} result The object onto which to store the result.\n * @returns {Cartesian4} The modified result parameter.\n */\nMatrix4.multiplyByVector = function (matrix, cartesian, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"matrix\", matrix);\n Check.typeOf.object(\"cartesian\", cartesian);\n Check.typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n\n const vX = cartesian.x;\n const vY = cartesian.y;\n const vZ = cartesian.z;\n const vW = cartesian.w;\n\n const x = matrix[0] * vX + matrix[4] * vY + matrix[8] * vZ + matrix[12] * vW;\n const y = matrix[1] * vX + matrix[5] * vY + matrix[9] * vZ + matrix[13] * vW;\n const z = matrix[2] * vX + matrix[6] * vY + matrix[10] * vZ + matrix[14] * vW;\n const w = matrix[3] * vX + matrix[7] * vY + matrix[11] * vZ + matrix[15] * vW;\n\n result.x = x;\n result.y = y;\n result.z = z;\n result.w = w;\n return result;\n};\n\n/**\n * Computes the product of a matrix and a {@link Cartesian3}. This is equivalent to calling {@link Matrix4.multiplyByVector}\n * with a {@link Cartesian4} with a w
component of zero.\n *\n * @param {Matrix4} matrix The matrix.\n * @param {Cartesian3} cartesian The point.\n * @param {Cartesian3} result The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter.\n *\n * @example\n * const p = new Cesium.Cartesian3(1.0, 2.0, 3.0);\n * const result = Cesium.Matrix4.multiplyByPointAsVector(matrix, p, new Cesium.Cartesian3());\n * // A shortcut for\n * // Cartesian3 p = ...\n * // Cesium.Matrix4.multiplyByVector(matrix, new Cesium.Cartesian4(p.x, p.y, p.z, 0.0), result);\n */\nMatrix4.multiplyByPointAsVector = function (matrix, cartesian, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"matrix\", matrix);\n Check.typeOf.object(\"cartesian\", cartesian);\n Check.typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n\n const vX = cartesian.x;\n const vY = cartesian.y;\n const vZ = cartesian.z;\n\n const x = matrix[0] * vX + matrix[4] * vY + matrix[8] * vZ;\n const y = matrix[1] * vX + matrix[5] * vY + matrix[9] * vZ;\n const z = matrix[2] * vX + matrix[6] * vY + matrix[10] * vZ;\n\n result.x = x;\n result.y = y;\n result.z = z;\n return result;\n};\n\n/**\n * Computes the product of a matrix and a {@link Cartesian3}. This is equivalent to calling {@link Matrix4.multiplyByVector}\n * with a {@link Cartesian4} with a w
component of 1, but returns a {@link Cartesian3} instead of a {@link Cartesian4}.\n *\n * @param {Matrix4} matrix The matrix.\n * @param {Cartesian3} cartesian The point.\n * @param {Cartesian3} result The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter.\n *\n * @example\n * const p = new Cesium.Cartesian3(1.0, 2.0, 3.0);\n * const result = Cesium.Matrix4.multiplyByPoint(matrix, p, new Cesium.Cartesian3());\n */\nMatrix4.multiplyByPoint = function (matrix, cartesian, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"matrix\", matrix);\n Check.typeOf.object(\"cartesian\", cartesian);\n Check.typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n\n const vX = cartesian.x;\n const vY = cartesian.y;\n const vZ = cartesian.z;\n\n const x = matrix[0] * vX + matrix[4] * vY + matrix[8] * vZ + matrix[12];\n const y = matrix[1] * vX + matrix[5] * vY + matrix[9] * vZ + matrix[13];\n const z = matrix[2] * vX + matrix[6] * vY + matrix[10] * vZ + matrix[14];\n\n result.x = x;\n result.y = y;\n result.z = z;\n return result;\n};\n\n/**\n * Computes the product of a matrix and a scalar.\n *\n * @param {Matrix4} matrix The matrix.\n * @param {number} scalar The number to multiply by.\n * @param {Matrix4} result The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter.\n *\n * @example\n * //create a Matrix4 instance which is a scaled version of the supplied Matrix4\n * // m = [10.0, 11.0, 12.0, 13.0]\n * // [14.0, 15.0, 16.0, 17.0]\n * // [18.0, 19.0, 20.0, 21.0]\n * // [22.0, 23.0, 24.0, 25.0]\n *\n * const a = Cesium.Matrix4.multiplyByScalar(m, -2, new Cesium.Matrix4());\n *\n * // m remains the same\n * // a = [-20.0, -22.0, -24.0, -26.0]\n * // [-28.0, -30.0, -32.0, -34.0]\n * // [-36.0, -38.0, -40.0, -42.0]\n * // [-44.0, -46.0, -48.0, -50.0]\n */\nMatrix4.multiplyByScalar = function (matrix, scalar, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"matrix\", matrix);\n Check.typeOf.number(\"scalar\", scalar);\n Check.typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n\n result[0] = matrix[0] * scalar;\n result[1] = matrix[1] * scalar;\n result[2] = matrix[2] * scalar;\n result[3] = matrix[3] * scalar;\n result[4] = matrix[4] * scalar;\n result[5] = matrix[5] * scalar;\n result[6] = matrix[6] * scalar;\n result[7] = matrix[7] * scalar;\n result[8] = matrix[8] * scalar;\n result[9] = matrix[9] * scalar;\n result[10] = matrix[10] * scalar;\n result[11] = matrix[11] * scalar;\n result[12] = matrix[12] * scalar;\n result[13] = matrix[13] * scalar;\n result[14] = matrix[14] * scalar;\n result[15] = matrix[15] * scalar;\n return result;\n};\n\n/**\n * Computes a negated copy of the provided matrix.\n *\n * @param {Matrix4} matrix The matrix to negate.\n * @param {Matrix4} result The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter.\n *\n * @example\n * //create a new Matrix4 instance which is a negation of a Matrix4\n * // m = [10.0, 11.0, 12.0, 13.0]\n * // [14.0, 15.0, 16.0, 17.0]\n * // [18.0, 19.0, 20.0, 21.0]\n * // [22.0, 23.0, 24.0, 25.0]\n *\n * const a = Cesium.Matrix4.negate(m, new Cesium.Matrix4());\n *\n * // m remains the same\n * // a = [-10.0, -11.0, -12.0, -13.0]\n * // [-14.0, -15.0, -16.0, -17.0]\n * // [-18.0, -19.0, -20.0, -21.0]\n * // [-22.0, -23.0, -24.0, -25.0]\n */\nMatrix4.negate = function (matrix, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"matrix\", matrix);\n Check.typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n\n result[0] = -matrix[0];\n result[1] = -matrix[1];\n result[2] = -matrix[2];\n result[3] = -matrix[3];\n result[4] = -matrix[4];\n result[5] = -matrix[5];\n result[6] = -matrix[6];\n result[7] = -matrix[7];\n result[8] = -matrix[8];\n result[9] = -matrix[9];\n result[10] = -matrix[10];\n result[11] = -matrix[11];\n result[12] = -matrix[12];\n result[13] = -matrix[13];\n result[14] = -matrix[14];\n result[15] = -matrix[15];\n return result;\n};\n\n/**\n * Computes the transpose of the provided matrix.\n *\n * @param {Matrix4} matrix The matrix to transpose.\n * @param {Matrix4} result The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter.\n *\n * @example\n * //returns transpose of a Matrix4\n * // m = [10.0, 11.0, 12.0, 13.0]\n * // [14.0, 15.0, 16.0, 17.0]\n * // [18.0, 19.0, 20.0, 21.0]\n * // [22.0, 23.0, 24.0, 25.0]\n *\n * const a = Cesium.Matrix4.transpose(m, new Cesium.Matrix4());\n *\n * // m remains the same\n * // a = [10.0, 14.0, 18.0, 22.0]\n * // [11.0, 15.0, 19.0, 23.0]\n * // [12.0, 16.0, 20.0, 24.0]\n * // [13.0, 17.0, 21.0, 25.0]\n */\nMatrix4.transpose = function (matrix, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"matrix\", matrix);\n Check.typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n\n const matrix1 = matrix[1];\n const matrix2 = matrix[2];\n const matrix3 = matrix[3];\n const matrix6 = matrix[6];\n const matrix7 = matrix[7];\n const matrix11 = matrix[11];\n\n result[0] = matrix[0];\n result[1] = matrix[4];\n result[2] = matrix[8];\n result[3] = matrix[12];\n result[4] = matrix1;\n result[5] = matrix[5];\n result[6] = matrix[9];\n result[7] = matrix[13];\n result[8] = matrix2;\n result[9] = matrix6;\n result[10] = matrix[10];\n result[11] = matrix[14];\n result[12] = matrix3;\n result[13] = matrix7;\n result[14] = matrix11;\n result[15] = matrix[15];\n return result;\n};\n\n/**\n * Computes a matrix, which contains the absolute (unsigned) values of the provided matrix's elements.\n *\n * @param {Matrix4} matrix The matrix with signed elements.\n * @param {Matrix4} result The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter.\n */\nMatrix4.abs = function (matrix, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"matrix\", matrix);\n Check.typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n\n result[0] = Math.abs(matrix[0]);\n result[1] = Math.abs(matrix[1]);\n result[2] = Math.abs(matrix[2]);\n result[3] = Math.abs(matrix[3]);\n result[4] = Math.abs(matrix[4]);\n result[5] = Math.abs(matrix[5]);\n result[6] = Math.abs(matrix[6]);\n result[7] = Math.abs(matrix[7]);\n result[8] = Math.abs(matrix[8]);\n result[9] = Math.abs(matrix[9]);\n result[10] = Math.abs(matrix[10]);\n result[11] = Math.abs(matrix[11]);\n result[12] = Math.abs(matrix[12]);\n result[13] = Math.abs(matrix[13]);\n result[14] = Math.abs(matrix[14]);\n result[15] = Math.abs(matrix[15]);\n\n return result;\n};\n\n/**\n * Compares the provided matrices componentwise and returns\n * true
if they are equal, false
otherwise.\n *\n * @param {Matrix4} [left] The first matrix.\n * @param {Matrix4} [right] The second matrix.\n * @returns {boolean} true
if left and right are equal, false
otherwise.\n *\n * @example\n * //compares two Matrix4 instances\n *\n * // a = [10.0, 14.0, 18.0, 22.0]\n * // [11.0, 15.0, 19.0, 23.0]\n * // [12.0, 16.0, 20.0, 24.0]\n * // [13.0, 17.0, 21.0, 25.0]\n *\n * // b = [10.0, 14.0, 18.0, 22.0]\n * // [11.0, 15.0, 19.0, 23.0]\n * // [12.0, 16.0, 20.0, 24.0]\n * // [13.0, 17.0, 21.0, 25.0]\n *\n * if(Cesium.Matrix4.equals(a,b)) {\n * console.log(\"Both matrices are equal\");\n * } else {\n * console.log(\"They are not equal\");\n * }\n *\n * //Prints \"Both matrices are equal\" on the console\n */\nMatrix4.equals = function (left, right) {\n // Given that most matrices will be transformation matrices, the elements\n // are tested in order such that the test is likely to fail as early\n // as possible. I _think_ this is just as friendly to the L1 cache\n // as testing in index order. It is certainty faster in practice.\n return (\n left === right ||\n (defined(left) &&\n defined(right) &&\n // Translation\n left[12] === right[12] &&\n left[13] === right[13] &&\n left[14] === right[14] &&\n // Rotation/scale\n left[0] === right[0] &&\n left[1] === right[1] &&\n left[2] === right[2] &&\n left[4] === right[4] &&\n left[5] === right[5] &&\n left[6] === right[6] &&\n left[8] === right[8] &&\n left[9] === right[9] &&\n left[10] === right[10] &&\n // Bottom row\n left[3] === right[3] &&\n left[7] === right[7] &&\n left[11] === right[11] &&\n left[15] === right[15])\n );\n};\n\n/**\n * Compares the provided matrices componentwise and returns\n * true
if they are within the provided epsilon,\n * false
otherwise.\n *\n * @param {Matrix4} [left] The first matrix.\n * @param {Matrix4} [right] The second matrix.\n * @param {number} [epsilon=0] The epsilon to use for equality testing.\n * @returns {boolean} true
if left and right are within the provided epsilon, false
otherwise.\n *\n * @example\n * //compares two Matrix4 instances\n *\n * // a = [10.5, 14.5, 18.5, 22.5]\n * // [11.5, 15.5, 19.5, 23.5]\n * // [12.5, 16.5, 20.5, 24.5]\n * // [13.5, 17.5, 21.5, 25.5]\n *\n * // b = [10.0, 14.0, 18.0, 22.0]\n * // [11.0, 15.0, 19.0, 23.0]\n * // [12.0, 16.0, 20.0, 24.0]\n * // [13.0, 17.0, 21.0, 25.0]\n *\n * if(Cesium.Matrix4.equalsEpsilon(a,b,0.1)){\n * console.log(\"Difference between both the matrices is less than 0.1\");\n * } else {\n * console.log(\"Difference between both the matrices is not less than 0.1\");\n * }\n *\n * //Prints \"Difference between both the matrices is not less than 0.1\" on the console\n */\nMatrix4.equalsEpsilon = function (left, right, epsilon) {\n epsilon = defaultValue(epsilon, 0);\n\n return (\n left === right ||\n (defined(left) &&\n defined(right) &&\n Math.abs(left[0] - right[0]) <= epsilon &&\n Math.abs(left[1] - right[1]) <= epsilon &&\n Math.abs(left[2] - right[2]) <= epsilon &&\n Math.abs(left[3] - right[3]) <= epsilon &&\n Math.abs(left[4] - right[4]) <= epsilon &&\n Math.abs(left[5] - right[5]) <= epsilon &&\n Math.abs(left[6] - right[6]) <= epsilon &&\n Math.abs(left[7] - right[7]) <= epsilon &&\n Math.abs(left[8] - right[8]) <= epsilon &&\n Math.abs(left[9] - right[9]) <= epsilon &&\n Math.abs(left[10] - right[10]) <= epsilon &&\n Math.abs(left[11] - right[11]) <= epsilon &&\n Math.abs(left[12] - right[12]) <= epsilon &&\n Math.abs(left[13] - right[13]) <= epsilon &&\n Math.abs(left[14] - right[14]) <= epsilon &&\n Math.abs(left[15] - right[15]) <= epsilon)\n );\n};\n\n/**\n * Gets the translation portion of the provided matrix, assuming the matrix is an affine transformation matrix.\n *\n * @param {Matrix4} matrix The matrix to use.\n * @param {Cartesian3} result The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter.\n */\nMatrix4.getTranslation = function (matrix, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"matrix\", matrix);\n Check.typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n\n result.x = matrix[12];\n result.y = matrix[13];\n result.z = matrix[14];\n return result;\n};\n\n/**\n * Gets the upper left 3x3 matrix of the provided matrix.\n *\n * @param {Matrix4} matrix The matrix to use.\n * @param {Matrix3} result The object onto which to store the result.\n * @returns {Matrix3} The modified result parameter.\n *\n * @example\n * // returns a Matrix3 instance from a Matrix4 instance\n *\n * // m = [10.0, 14.0, 18.0, 22.0]\n * // [11.0, 15.0, 19.0, 23.0]\n * // [12.0, 16.0, 20.0, 24.0]\n * // [13.0, 17.0, 21.0, 25.0]\n *\n * const b = new Cesium.Matrix3();\n * Cesium.Matrix4.getMatrix3(m,b);\n *\n * // b = [10.0, 14.0, 18.0]\n * // [11.0, 15.0, 19.0]\n * // [12.0, 16.0, 20.0]\n */\nMatrix4.getMatrix3 = function (matrix, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"matrix\", matrix);\n Check.typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n\n result[0] = matrix[0];\n result[1] = matrix[1];\n result[2] = matrix[2];\n result[3] = matrix[4];\n result[4] = matrix[5];\n result[5] = matrix[6];\n result[6] = matrix[8];\n result[7] = matrix[9];\n result[8] = matrix[10];\n return result;\n};\n\nconst scratchInverseRotation = new Matrix3();\nconst scratchMatrix3Zero = new Matrix3();\nconst scratchBottomRow = new Cartesian4();\nconst scratchExpectedBottomRow = new Cartesian4(0.0, 0.0, 0.0, 1.0);\n\n/**\n * Computes the inverse of the provided matrix using Cramers Rule.\n * If the determinant is zero, the matrix can not be inverted, and an exception is thrown.\n * If the matrix is a proper rigid transformation, it is more efficient\n * to invert it with {@link Matrix4.inverseTransformation}.\n *\n * @param {Matrix4} matrix The matrix to invert.\n * @param {Matrix4} result The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter.\n *\n * @exception {RuntimeError} matrix is not invertible because its determinate is zero.\n */\nMatrix4.inverse = function (matrix, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"matrix\", matrix);\n Check.typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n //\n // Ported from:\n // ftp://download.intel.com/design/PentiumIII/sml/24504301.pdf\n //\n const src0 = matrix[0];\n const src1 = matrix[4];\n const src2 = matrix[8];\n const src3 = matrix[12];\n const src4 = matrix[1];\n const src5 = matrix[5];\n const src6 = matrix[9];\n const src7 = matrix[13];\n const src8 = matrix[2];\n const src9 = matrix[6];\n const src10 = matrix[10];\n const src11 = matrix[14];\n const src12 = matrix[3];\n const src13 = matrix[7];\n const src14 = matrix[11];\n const src15 = matrix[15];\n\n // calculate pairs for first 8 elements (cofactors)\n let tmp0 = src10 * src15;\n let tmp1 = src11 * src14;\n let tmp2 = src9 * src15;\n let tmp3 = src11 * src13;\n let tmp4 = src9 * src14;\n let tmp5 = src10 * src13;\n let tmp6 = src8 * src15;\n let tmp7 = src11 * src12;\n let tmp8 = src8 * src14;\n let tmp9 = src10 * src12;\n let tmp10 = src8 * src13;\n let tmp11 = src9 * src12;\n\n // calculate first 8 elements (cofactors)\n const dst0 =\n tmp0 * src5 +\n tmp3 * src6 +\n tmp4 * src7 -\n (tmp1 * src5 + tmp2 * src6 + tmp5 * src7);\n const dst1 =\n tmp1 * src4 +\n tmp6 * src6 +\n tmp9 * src7 -\n (tmp0 * src4 + tmp7 * src6 + tmp8 * src7);\n const dst2 =\n tmp2 * src4 +\n tmp7 * src5 +\n tmp10 * src7 -\n (tmp3 * src4 + tmp6 * src5 + tmp11 * src7);\n const dst3 =\n tmp5 * src4 +\n tmp8 * src5 +\n tmp11 * src6 -\n (tmp4 * src4 + tmp9 * src5 + tmp10 * src6);\n const dst4 =\n tmp1 * src1 +\n tmp2 * src2 +\n tmp5 * src3 -\n (tmp0 * src1 + tmp3 * src2 + tmp4 * src3);\n const dst5 =\n tmp0 * src0 +\n tmp7 * src2 +\n tmp8 * src3 -\n (tmp1 * src0 + tmp6 * src2 + tmp9 * src3);\n const dst6 =\n tmp3 * src0 +\n tmp6 * src1 +\n tmp11 * src3 -\n (tmp2 * src0 + tmp7 * src1 + tmp10 * src3);\n const dst7 =\n tmp4 * src0 +\n tmp9 * src1 +\n tmp10 * src2 -\n (tmp5 * src0 + tmp8 * src1 + tmp11 * src2);\n\n // calculate pairs for second 8 elements (cofactors)\n tmp0 = src2 * src7;\n tmp1 = src3 * src6;\n tmp2 = src1 * src7;\n tmp3 = src3 * src5;\n tmp4 = src1 * src6;\n tmp5 = src2 * src5;\n tmp6 = src0 * src7;\n tmp7 = src3 * src4;\n tmp8 = src0 * src6;\n tmp9 = src2 * src4;\n tmp10 = src0 * src5;\n tmp11 = src1 * src4;\n\n // calculate second 8 elements (cofactors)\n const dst8 =\n tmp0 * src13 +\n tmp3 * src14 +\n tmp4 * src15 -\n (tmp1 * src13 + tmp2 * src14 + tmp5 * src15);\n const dst9 =\n tmp1 * src12 +\n tmp6 * src14 +\n tmp9 * src15 -\n (tmp0 * src12 + tmp7 * src14 + tmp8 * src15);\n const dst10 =\n tmp2 * src12 +\n tmp7 * src13 +\n tmp10 * src15 -\n (tmp3 * src12 + tmp6 * src13 + tmp11 * src15);\n const dst11 =\n tmp5 * src12 +\n tmp8 * src13 +\n tmp11 * src14 -\n (tmp4 * src12 + tmp9 * src13 + tmp10 * src14);\n const dst12 =\n tmp2 * src10 +\n tmp5 * src11 +\n tmp1 * src9 -\n (tmp4 * src11 + tmp0 * src9 + tmp3 * src10);\n const dst13 =\n tmp8 * src11 +\n tmp0 * src8 +\n tmp7 * src10 -\n (tmp6 * src10 + tmp9 * src11 + tmp1 * src8);\n const dst14 =\n tmp6 * src9 +\n tmp11 * src11 +\n tmp3 * src8 -\n (tmp10 * src11 + tmp2 * src8 + tmp7 * src9);\n const dst15 =\n tmp10 * src10 +\n tmp4 * src8 +\n tmp9 * src9 -\n (tmp8 * src9 + tmp11 * src10 + tmp5 * src8);\n\n // calculate determinant\n let det = src0 * dst0 + src1 * dst1 + src2 * dst2 + src3 * dst3;\n\n if (Math.abs(det) < CesiumMath.EPSILON21) {\n // Special case for a zero scale matrix that can occur, for example,\n // when a model's node has a [0, 0, 0] scale.\n if (\n Matrix3.equalsEpsilon(\n Matrix4.getMatrix3(matrix, scratchInverseRotation),\n scratchMatrix3Zero,\n CesiumMath.EPSILON7,\n ) &&\n Cartesian4.equals(\n Matrix4.getRow(matrix, 3, scratchBottomRow),\n scratchExpectedBottomRow,\n )\n ) {\n result[0] = 0.0;\n result[1] = 0.0;\n result[2] = 0.0;\n result[3] = 0.0;\n result[4] = 0.0;\n result[5] = 0.0;\n result[6] = 0.0;\n result[7] = 0.0;\n result[8] = 0.0;\n result[9] = 0.0;\n result[10] = 0.0;\n result[11] = 0.0;\n result[12] = -matrix[12];\n result[13] = -matrix[13];\n result[14] = -matrix[14];\n result[15] = 1.0;\n return result;\n }\n\n throw new RuntimeError(\n \"matrix is not invertible because its determinate is zero.\",\n );\n }\n\n // calculate matrix inverse\n det = 1.0 / det;\n\n result[0] = dst0 * det;\n result[1] = dst1 * det;\n result[2] = dst2 * det;\n result[3] = dst3 * det;\n result[4] = dst4 * det;\n result[5] = dst5 * det;\n result[6] = dst6 * det;\n result[7] = dst7 * det;\n result[8] = dst8 * det;\n result[9] = dst9 * det;\n result[10] = dst10 * det;\n result[11] = dst11 * det;\n result[12] = dst12 * det;\n result[13] = dst13 * det;\n result[14] = dst14 * det;\n result[15] = dst15 * det;\n return result;\n};\n\n/**\n * Computes the inverse of the provided matrix assuming it is a proper rigid matrix,\n * where the upper left 3x3 elements are a rotation matrix,\n * and the upper three elements in the fourth column are the translation.\n * The bottom row is assumed to be [0, 0, 0, 1].\n * The matrix is not verified to be in the proper form.\n * This method is faster than computing the inverse for a general 4x4\n * matrix using {@link Matrix4.inverse}.\n *\n * @param {Matrix4} matrix The matrix to invert.\n * @param {Matrix4} result The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter.\n */\nMatrix4.inverseTransformation = function (matrix, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"matrix\", matrix);\n Check.typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n\n //This function is an optimized version of the below 4 lines.\n //const rT = Matrix3.transpose(Matrix4.getMatrix3(matrix));\n //const rTN = Matrix3.negate(rT);\n //const rTT = Matrix3.multiplyByVector(rTN, Matrix4.getTranslation(matrix));\n //return Matrix4.fromRotationTranslation(rT, rTT, result);\n\n const matrix0 = matrix[0];\n const matrix1 = matrix[1];\n const matrix2 = matrix[2];\n const matrix4 = matrix[4];\n const matrix5 = matrix[5];\n const matrix6 = matrix[6];\n const matrix8 = matrix[8];\n const matrix9 = matrix[9];\n const matrix10 = matrix[10];\n\n const vX = matrix[12];\n const vY = matrix[13];\n const vZ = matrix[14];\n\n const x = -matrix0 * vX - matrix1 * vY - matrix2 * vZ;\n const y = -matrix4 * vX - matrix5 * vY - matrix6 * vZ;\n const z = -matrix8 * vX - matrix9 * vY - matrix10 * vZ;\n\n result[0] = matrix0;\n result[1] = matrix4;\n result[2] = matrix8;\n result[3] = 0.0;\n result[4] = matrix1;\n result[5] = matrix5;\n result[6] = matrix9;\n result[7] = 0.0;\n result[8] = matrix2;\n result[9] = matrix6;\n result[10] = matrix10;\n result[11] = 0.0;\n result[12] = x;\n result[13] = y;\n result[14] = z;\n result[15] = 1.0;\n return result;\n};\n\nconst scratchTransposeMatrix = new Matrix4();\n\n/**\n * Computes the inverse transpose of a matrix.\n *\n * @param {Matrix4} matrix The matrix to transpose and invert.\n * @param {Matrix4} result The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter.\n */\nMatrix4.inverseTranspose = function (matrix, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"matrix\", matrix);\n Check.typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n\n return Matrix4.inverse(\n Matrix4.transpose(matrix, scratchTransposeMatrix),\n result,\n );\n};\n\n/**\n * An immutable Matrix4 instance initialized to the identity matrix.\n *\n * @type {Matrix4}\n * @constant\n */\nMatrix4.IDENTITY = Object.freeze(\n new Matrix4(\n 1.0,\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n 1.0,\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n 1.0,\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n 1.0,\n ),\n);\n\n/**\n * An immutable Matrix4 instance initialized to the zero matrix.\n *\n * @type {Matrix4}\n * @constant\n */\nMatrix4.ZERO = Object.freeze(\n new Matrix4(\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n ),\n);\n\n/**\n * The index into Matrix4 for column 0, row 0.\n *\n * @type {number}\n * @constant\n */\nMatrix4.COLUMN0ROW0 = 0;\n\n/**\n * The index into Matrix4 for column 0, row 1.\n *\n * @type {number}\n * @constant\n */\nMatrix4.COLUMN0ROW1 = 1;\n\n/**\n * The index into Matrix4 for column 0, row 2.\n *\n * @type {number}\n * @constant\n */\nMatrix4.COLUMN0ROW2 = 2;\n\n/**\n * The index into Matrix4 for column 0, row 3.\n *\n * @type {number}\n * @constant\n */\nMatrix4.COLUMN0ROW3 = 3;\n\n/**\n * The index into Matrix4 for column 1, row 0.\n *\n * @type {number}\n * @constant\n */\nMatrix4.COLUMN1ROW0 = 4;\n\n/**\n * The index into Matrix4 for column 1, row 1.\n *\n * @type {number}\n * @constant\n */\nMatrix4.COLUMN1ROW1 = 5;\n\n/**\n * The index into Matrix4 for column 1, row 2.\n *\n * @type {number}\n * @constant\n */\nMatrix4.COLUMN1ROW2 = 6;\n\n/**\n * The index into Matrix4 for column 1, row 3.\n *\n * @type {number}\n * @constant\n */\nMatrix4.COLUMN1ROW3 = 7;\n\n/**\n * The index into Matrix4 for column 2, row 0.\n *\n * @type {number}\n * @constant\n */\nMatrix4.COLUMN2ROW0 = 8;\n\n/**\n * The index into Matrix4 for column 2, row 1.\n *\n * @type {number}\n * @constant\n */\nMatrix4.COLUMN2ROW1 = 9;\n\n/**\n * The index into Matrix4 for column 2, row 2.\n *\n * @type {number}\n * @constant\n */\nMatrix4.COLUMN2ROW2 = 10;\n\n/**\n * The index into Matrix4 for column 2, row 3.\n *\n * @type {number}\n * @constant\n */\nMatrix4.COLUMN2ROW3 = 11;\n\n/**\n * The index into Matrix4 for column 3, row 0.\n *\n * @type {number}\n * @constant\n */\nMatrix4.COLUMN3ROW0 = 12;\n\n/**\n * The index into Matrix4 for column 3, row 1.\n *\n * @type {number}\n * @constant\n */\nMatrix4.COLUMN3ROW1 = 13;\n\n/**\n * The index into Matrix4 for column 3, row 2.\n *\n * @type {number}\n * @constant\n */\nMatrix4.COLUMN3ROW2 = 14;\n\n/**\n * The index into Matrix4 for column 3, row 3.\n *\n * @type {number}\n * @constant\n */\nMatrix4.COLUMN3ROW3 = 15;\n\nObject.defineProperties(Matrix4.prototype, {\n /**\n * Gets the number of items in the collection.\n * @memberof Matrix4.prototype\n *\n * @type {number}\n */\n length: {\n get: function () {\n return Matrix4.packedLength;\n },\n },\n});\n\n/**\n * Duplicates the provided Matrix4 instance.\n *\n * @param {Matrix4} [result] The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter or a new Matrix4 instance if one was not provided.\n */\nMatrix4.prototype.clone = function (result) {\n return Matrix4.clone(this, result);\n};\n\n/**\n * Compares this matrix to the provided matrix componentwise and returns\n * true
if they are equal, false
otherwise.\n *\n * @param {Matrix4} [right] The right hand side matrix.\n * @returns {boolean} true
if they are equal, false
otherwise.\n */\nMatrix4.prototype.equals = function (right) {\n return Matrix4.equals(this, right);\n};\n\n/**\n * @private\n */\nMatrix4.equalsArray = function (matrix, array, offset) {\n return (\n matrix[0] === array[offset] &&\n matrix[1] === array[offset + 1] &&\n matrix[2] === array[offset + 2] &&\n matrix[3] === array[offset + 3] &&\n matrix[4] === array[offset + 4] &&\n matrix[5] === array[offset + 5] &&\n matrix[6] === array[offset + 6] &&\n matrix[7] === array[offset + 7] &&\n matrix[8] === array[offset + 8] &&\n matrix[9] === array[offset + 9] &&\n matrix[10] === array[offset + 10] &&\n matrix[11] === array[offset + 11] &&\n matrix[12] === array[offset + 12] &&\n matrix[13] === array[offset + 13] &&\n matrix[14] === array[offset + 14] &&\n matrix[15] === array[offset + 15]\n );\n};\n\n/**\n * Compares this matrix to the provided matrix componentwise and returns\n * true
if they are within the provided epsilon,\n * false
otherwise.\n *\n * @param {Matrix4} [right] The right hand side matrix.\n * @param {number} [epsilon=0] The epsilon to use for equality testing.\n * @returns {boolean} true
if they are within the provided epsilon, false
otherwise.\n */\nMatrix4.prototype.equalsEpsilon = function (right, epsilon) {\n return Matrix4.equalsEpsilon(this, right, epsilon);\n};\n\n/**\n * Computes a string representing this Matrix with each row being\n * on a separate line and in the format '(column0, column1, column2, column3)'.\n *\n * @returns {string} A string representing the provided Matrix with each row being on a separate line and in the format '(column0, column1, column2, column3)'.\n */\nMatrix4.prototype.toString = function () {\n return (\n `(${this[0]}, ${this[4]}, ${this[8]}, ${this[12]})\\n` +\n `(${this[1]}, ${this[5]}, ${this[9]}, ${this[13]})\\n` +\n `(${this[2]}, ${this[6]}, ${this[10]}, ${this[14]})\\n` +\n `(${this[3]}, ${this[7]}, ${this[11]}, ${this[15]})`\n );\n};\nexport default Matrix4;\n","import Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport CesiumMath from \"./Math.js\";\n\n/**\n * A 4D Cartesian point.\n * @alias Cartesian4\n * @constructor\n *\n * @param {number} [x=0.0] The X component.\n * @param {number} [y=0.0] The Y component.\n * @param {number} [z=0.0] The Z component.\n * @param {number} [w=0.0] The W component.\n *\n * @see Cartesian2\n * @see Cartesian3\n * @see Packable\n */\nfunction Cartesian4(x, y, z, w) {\n /**\n * The X component.\n * @type {number}\n * @default 0.0\n */\n this.x = defaultValue(x, 0.0);\n\n /**\n * The Y component.\n * @type {number}\n * @default 0.0\n */\n this.y = defaultValue(y, 0.0);\n\n /**\n * The Z component.\n * @type {number}\n * @default 0.0\n */\n this.z = defaultValue(z, 0.0);\n\n /**\n * The W component.\n * @type {number}\n * @default 0.0\n */\n this.w = defaultValue(w, 0.0);\n}\n\n/**\n * Creates a Cartesian4 instance from x, y, z and w coordinates.\n *\n * @param {number} x The x coordinate.\n * @param {number} y The y coordinate.\n * @param {number} z The z coordinate.\n * @param {number} w The w coordinate.\n * @param {Cartesian4} [result] The object onto which to store the result.\n * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided.\n */\nCartesian4.fromElements = function (x, y, z, w, result) {\n if (!defined(result)) {\n return new Cartesian4(x, y, z, w);\n }\n\n result.x = x;\n result.y = y;\n result.z = z;\n result.w = w;\n return result;\n};\n\n/**\n * Creates a Cartesian4 instance from a {@link Color}. red
, green
, blue
,\n * and alpha
map to x
, y
, z
, and w
, respectively.\n *\n * @param {Color} color The source color.\n * @param {Cartesian4} [result] The object onto which to store the result.\n * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided.\n */\nCartesian4.fromColor = function (color, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"color\", color);\n //>>includeEnd('debug');\n if (!defined(result)) {\n return new Cartesian4(color.red, color.green, color.blue, color.alpha);\n }\n\n result.x = color.red;\n result.y = color.green;\n result.z = color.blue;\n result.w = color.alpha;\n return result;\n};\n\n/**\n * Duplicates a Cartesian4 instance.\n *\n * @param {Cartesian4} cartesian The Cartesian to duplicate.\n * @param {Cartesian4} [result] The object onto which to store the result.\n * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided. (Returns undefined if cartesian is undefined)\n */\nCartesian4.clone = function (cartesian, result) {\n if (!defined(cartesian)) {\n return undefined;\n }\n\n if (!defined(result)) {\n return new Cartesian4(cartesian.x, cartesian.y, cartesian.z, cartesian.w);\n }\n\n result.x = cartesian.x;\n result.y = cartesian.y;\n result.z = cartesian.z;\n result.w = cartesian.w;\n return result;\n};\n\n/**\n * The number of elements used to pack the object into an array.\n * @type {number}\n */\nCartesian4.packedLength = 4;\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {Cartesian4} value The value to pack.\n * @param {number[]} array The array to pack into.\n * @param {number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {number[]} The array that was packed into\n */\nCartesian4.pack = function (value, array, startingIndex) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"value\", value);\n Check.defined(\"array\", array);\n //>>includeEnd('debug');\n\n startingIndex = defaultValue(startingIndex, 0);\n\n array[startingIndex++] = value.x;\n array[startingIndex++] = value.y;\n array[startingIndex++] = value.z;\n array[startingIndex] = value.w;\n\n return array;\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {number[]} array The packed array.\n * @param {number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {Cartesian4} [result] The object into which to store the result.\n * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided.\n */\nCartesian4.unpack = function (array, startingIndex, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.defined(\"array\", array);\n //>>includeEnd('debug');\n\n startingIndex = defaultValue(startingIndex, 0);\n\n if (!defined(result)) {\n result = new Cartesian4();\n }\n result.x = array[startingIndex++];\n result.y = array[startingIndex++];\n result.z = array[startingIndex++];\n result.w = array[startingIndex];\n return result;\n};\n\n/**\n * Flattens an array of Cartesian4s into an array of components.\n *\n * @param {Cartesian4[]} array The array of cartesians to pack.\n * @param {number[]} [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.\n * @returns {number[]} The packed array.\n */\nCartesian4.packArray = function (array, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.defined(\"array\", array);\n //>>includeEnd('debug');\n\n const length = array.length;\n const resultLength = length * 4;\n if (!defined(result)) {\n result = new Array(resultLength);\n } else if (!Array.isArray(result) && result.length !== resultLength) {\n //>>includeStart('debug', pragmas.debug);\n throw new DeveloperError(\n \"If result is a typed array, it must have exactly array.length * 4 elements\",\n );\n //>>includeEnd('debug');\n } else if (result.length !== resultLength) {\n result.length = resultLength;\n }\n\n for (let i = 0; i < length; ++i) {\n Cartesian4.pack(array[i], result, i * 4);\n }\n return result;\n};\n\n/**\n * Unpacks an array of cartesian components into an array of Cartesian4s.\n *\n * @param {number[]} array The array of components to unpack.\n * @param {Cartesian4[]} [result] The array onto which to store the result.\n * @returns {Cartesian4[]} The unpacked array.\n */\nCartesian4.unpackArray = function (array, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.defined(\"array\", array);\n Check.typeOf.number.greaterThanOrEquals(\"array.length\", array.length, 4);\n if (array.length % 4 !== 0) {\n throw new DeveloperError(\"array length must be a multiple of 4.\");\n }\n //>>includeEnd('debug');\n\n const length = array.length;\n if (!defined(result)) {\n result = new Array(length / 4);\n } else {\n result.length = length / 4;\n }\n\n for (let i = 0; i < length; i += 4) {\n const index = i / 4;\n result[index] = Cartesian4.unpack(array, i, result[index]);\n }\n return result;\n};\n\n/**\n * Creates a Cartesian4 from four consecutive elements in an array.\n * @function\n *\n * @param {number[]} array The array whose four consecutive elements correspond to the x, y, z, and w components, respectively.\n * @param {number} [startingIndex=0] The offset into the array of the first element, which corresponds to the x component.\n * @param {Cartesian4} [result] The object onto which to store the result.\n * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided.\n *\n * @example\n * // Create a Cartesian4 with (1.0, 2.0, 3.0, 4.0)\n * const v = [1.0, 2.0, 3.0, 4.0];\n * const p = Cesium.Cartesian4.fromArray(v);\n *\n * // Create a Cartesian4 with (1.0, 2.0, 3.0, 4.0) using an offset into an array\n * const v2 = [0.0, 0.0, 1.0, 2.0, 3.0, 4.0];\n * const p2 = Cesium.Cartesian4.fromArray(v2, 2);\n */\nCartesian4.fromArray = Cartesian4.unpack;\n\n/**\n * Computes the value of the maximum component for the supplied Cartesian.\n *\n * @param {Cartesian4} cartesian The cartesian to use.\n * @returns {number} The value of the maximum component.\n */\nCartesian4.maximumComponent = function (cartesian) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"cartesian\", cartesian);\n //>>includeEnd('debug');\n\n return Math.max(cartesian.x, cartesian.y, cartesian.z, cartesian.w);\n};\n\n/**\n * Computes the value of the minimum component for the supplied Cartesian.\n *\n * @param {Cartesian4} cartesian The cartesian to use.\n * @returns {number} The value of the minimum component.\n */\nCartesian4.minimumComponent = function (cartesian) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"cartesian\", cartesian);\n //>>includeEnd('debug');\n\n return Math.min(cartesian.x, cartesian.y, cartesian.z, cartesian.w);\n};\n\n/**\n * Compares two Cartesians and computes a Cartesian which contains the minimum components of the supplied Cartesians.\n *\n * @param {Cartesian4} first A cartesian to compare.\n * @param {Cartesian4} second A cartesian to compare.\n * @param {Cartesian4} result The object into which to store the result.\n * @returns {Cartesian4} A cartesian with the minimum components.\n */\nCartesian4.minimumByComponent = function (first, second, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"first\", first);\n Check.typeOf.object(\"second\", second);\n Check.typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n\n result.x = Math.min(first.x, second.x);\n result.y = Math.min(first.y, second.y);\n result.z = Math.min(first.z, second.z);\n result.w = Math.min(first.w, second.w);\n\n return result;\n};\n\n/**\n * Compares two Cartesians and computes a Cartesian which contains the maximum components of the supplied Cartesians.\n *\n * @param {Cartesian4} first A cartesian to compare.\n * @param {Cartesian4} second A cartesian to compare.\n * @param {Cartesian4} result The object into which to store the result.\n * @returns {Cartesian4} A cartesian with the maximum components.\n */\nCartesian4.maximumByComponent = function (first, second, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"first\", first);\n Check.typeOf.object(\"second\", second);\n Check.typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n\n result.x = Math.max(first.x, second.x);\n result.y = Math.max(first.y, second.y);\n result.z = Math.max(first.z, second.z);\n result.w = Math.max(first.w, second.w);\n\n return result;\n};\n\n/**\n * Constrain a value to lie between two values.\n *\n * @param {Cartesian4} value The value to clamp.\n * @param {Cartesian4} min The minimum bound.\n * @param {Cartesian4} max The maximum bound.\n * @param {Cartesian4} result The object into which to store the result.\n * @returns {Cartesian4} The clamped value such that min <= result <= max.\n */\nCartesian4.clamp = function (value, min, max, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"value\", value);\n Check.typeOf.object(\"min\", min);\n Check.typeOf.object(\"max\", max);\n Check.typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n\n const x = CesiumMath.clamp(value.x, min.x, max.x);\n const y = CesiumMath.clamp(value.y, min.y, max.y);\n const z = CesiumMath.clamp(value.z, min.z, max.z);\n const w = CesiumMath.clamp(value.w, min.w, max.w);\n\n result.x = x;\n result.y = y;\n result.z = z;\n result.w = w;\n\n return result;\n};\n\n/**\n * Computes the provided Cartesian's squared magnitude.\n *\n * @param {Cartesian4} cartesian The Cartesian instance whose squared magnitude is to be computed.\n * @returns {number} The squared magnitude.\n */\nCartesian4.magnitudeSquared = function (cartesian) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"cartesian\", cartesian);\n //>>includeEnd('debug');\n\n return (\n cartesian.x * cartesian.x +\n cartesian.y * cartesian.y +\n cartesian.z * cartesian.z +\n cartesian.w * cartesian.w\n );\n};\n\n/**\n * Computes the Cartesian's magnitude (length).\n *\n * @param {Cartesian4} cartesian The Cartesian instance whose magnitude is to be computed.\n * @returns {number} The magnitude.\n */\nCartesian4.magnitude = function (cartesian) {\n return Math.sqrt(Cartesian4.magnitudeSquared(cartesian));\n};\n\nconst distanceScratch = new Cartesian4();\n\n/**\n * Computes the 4-space distance between two points.\n *\n * @param {Cartesian4} left The first point to compute the distance from.\n * @param {Cartesian4} right The second point to compute the distance to.\n * @returns {number} The distance between two points.\n *\n * @example\n * // Returns 1.0\n * const d = Cesium.Cartesian4.distance(\n * new Cesium.Cartesian4(1.0, 0.0, 0.0, 0.0),\n * new Cesium.Cartesian4(2.0, 0.0, 0.0, 0.0));\n */\nCartesian4.distance = function (left, right) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"left\", left);\n Check.typeOf.object(\"right\", right);\n //>>includeEnd('debug');\n\n Cartesian4.subtract(left, right, distanceScratch);\n return Cartesian4.magnitude(distanceScratch);\n};\n\n/**\n * Computes the squared distance between two points. Comparing squared distances\n * using this function is more efficient than comparing distances using {@link Cartesian4#distance}.\n *\n * @param {Cartesian4} left The first point to compute the distance from.\n * @param {Cartesian4} right The second point to compute the distance to.\n * @returns {number} The distance between two points.\n *\n * @example\n * // Returns 4.0, not 2.0\n * const d = Cesium.Cartesian4.distance(\n * new Cesium.Cartesian4(1.0, 0.0, 0.0, 0.0),\n * new Cesium.Cartesian4(3.0, 0.0, 0.0, 0.0));\n */\nCartesian4.distanceSquared = function (left, right) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"left\", left);\n Check.typeOf.object(\"right\", right);\n //>>includeEnd('debug');\n\n Cartesian4.subtract(left, right, distanceScratch);\n return Cartesian4.magnitudeSquared(distanceScratch);\n};\n\n/**\n * Computes the normalized form of the supplied Cartesian.\n *\n * @param {Cartesian4} cartesian The Cartesian to be normalized.\n * @param {Cartesian4} result The object onto which to store the result.\n * @returns {Cartesian4} The modified result parameter.\n */\nCartesian4.normalize = function (cartesian, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"cartesian\", cartesian);\n Check.typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n\n const magnitude = Cartesian4.magnitude(cartesian);\n\n result.x = cartesian.x / magnitude;\n result.y = cartesian.y / magnitude;\n result.z = cartesian.z / magnitude;\n result.w = cartesian.w / magnitude;\n\n //>>includeStart('debug', pragmas.debug);\n if (\n isNaN(result.x) ||\n isNaN(result.y) ||\n isNaN(result.z) ||\n isNaN(result.w)\n ) {\n throw new DeveloperError(\"normalized result is not a number\");\n }\n //>>includeEnd('debug');\n\n return result;\n};\n\n/**\n * Computes the dot (scalar) product of two Cartesians.\n *\n * @param {Cartesian4} left The first Cartesian.\n * @param {Cartesian4} right The second Cartesian.\n * @returns {number} The dot product.\n */\nCartesian4.dot = function (left, right) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"left\", left);\n Check.typeOf.object(\"right\", right);\n //>>includeEnd('debug');\n\n return (\n left.x * right.x + left.y * right.y + left.z * right.z + left.w * right.w\n );\n};\n\n/**\n * Computes the componentwise product of two Cartesians.\n *\n * @param {Cartesian4} left The first Cartesian.\n * @param {Cartesian4} right The second Cartesian.\n * @param {Cartesian4} result The object onto which to store the result.\n * @returns {Cartesian4} The modified result parameter.\n */\nCartesian4.multiplyComponents = function (left, right, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"left\", left);\n Check.typeOf.object(\"right\", right);\n Check.typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n\n result.x = left.x * right.x;\n result.y = left.y * right.y;\n result.z = left.z * right.z;\n result.w = left.w * right.w;\n return result;\n};\n\n/**\n * Computes the componentwise quotient of two Cartesians.\n *\n * @param {Cartesian4} left The first Cartesian.\n * @param {Cartesian4} right The second Cartesian.\n * @param {Cartesian4} result The object onto which to store the result.\n * @returns {Cartesian4} The modified result parameter.\n */\nCartesian4.divideComponents = function (left, right, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"left\", left);\n Check.typeOf.object(\"right\", right);\n Check.typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n\n result.x = left.x / right.x;\n result.y = left.y / right.y;\n result.z = left.z / right.z;\n result.w = left.w / right.w;\n return result;\n};\n\n/**\n * Computes the componentwise sum of two Cartesians.\n *\n * @param {Cartesian4} left The first Cartesian.\n * @param {Cartesian4} right The second Cartesian.\n * @param {Cartesian4} result The object onto which to store the result.\n * @returns {Cartesian4} The modified result parameter.\n */\nCartesian4.add = function (left, right, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"left\", left);\n Check.typeOf.object(\"right\", right);\n Check.typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n\n result.x = left.x + right.x;\n result.y = left.y + right.y;\n result.z = left.z + right.z;\n result.w = left.w + right.w;\n return result;\n};\n\n/**\n * Computes the componentwise difference of two Cartesians.\n *\n * @param {Cartesian4} left The first Cartesian.\n * @param {Cartesian4} right The second Cartesian.\n * @param {Cartesian4} result The object onto which to store the result.\n * @returns {Cartesian4} The modified result parameter.\n */\nCartesian4.subtract = function (left, right, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"left\", left);\n Check.typeOf.object(\"right\", right);\n Check.typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n\n result.x = left.x - right.x;\n result.y = left.y - right.y;\n result.z = left.z - right.z;\n result.w = left.w - right.w;\n return result;\n};\n\n/**\n * Multiplies the provided Cartesian componentwise by the provided scalar.\n *\n * @param {Cartesian4} cartesian The Cartesian to be scaled.\n * @param {number} scalar The scalar to multiply with.\n * @param {Cartesian4} result The object onto which to store the result.\n * @returns {Cartesian4} The modified result parameter.\n */\nCartesian4.multiplyByScalar = function (cartesian, scalar, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"cartesian\", cartesian);\n Check.typeOf.number(\"scalar\", scalar);\n Check.typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n\n result.x = cartesian.x * scalar;\n result.y = cartesian.y * scalar;\n result.z = cartesian.z * scalar;\n result.w = cartesian.w * scalar;\n return result;\n};\n\n/**\n * Divides the provided Cartesian componentwise by the provided scalar.\n *\n * @param {Cartesian4} cartesian The Cartesian to be divided.\n * @param {number} scalar The scalar to divide by.\n * @param {Cartesian4} result The object onto which to store the result.\n * @returns {Cartesian4} The modified result parameter.\n */\nCartesian4.divideByScalar = function (cartesian, scalar, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"cartesian\", cartesian);\n Check.typeOf.number(\"scalar\", scalar);\n Check.typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n\n result.x = cartesian.x / scalar;\n result.y = cartesian.y / scalar;\n result.z = cartesian.z / scalar;\n result.w = cartesian.w / scalar;\n return result;\n};\n\n/**\n * Negates the provided Cartesian.\n *\n * @param {Cartesian4} cartesian The Cartesian to be negated.\n * @param {Cartesian4} result The object onto which to store the result.\n * @returns {Cartesian4} The modified result parameter.\n */\nCartesian4.negate = function (cartesian, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"cartesian\", cartesian);\n Check.typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n\n result.x = -cartesian.x;\n result.y = -cartesian.y;\n result.z = -cartesian.z;\n result.w = -cartesian.w;\n return result;\n};\n\n/**\n * Computes the absolute value of the provided Cartesian.\n *\n * @param {Cartesian4} cartesian The Cartesian whose absolute value is to be computed.\n * @param {Cartesian4} result The object onto which to store the result.\n * @returns {Cartesian4} The modified result parameter.\n */\nCartesian4.abs = function (cartesian, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"cartesian\", cartesian);\n Check.typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n\n result.x = Math.abs(cartesian.x);\n result.y = Math.abs(cartesian.y);\n result.z = Math.abs(cartesian.z);\n result.w = Math.abs(cartesian.w);\n return result;\n};\n\nconst lerpScratch = new Cartesian4();\n/**\n * Computes the linear interpolation or extrapolation at t using the provided cartesians.\n *\n * @param {Cartesian4} start The value corresponding to t at 0.0.\n * @param {Cartesian4}end The value corresponding to t at 1.0.\n * @param {number} t The point along t at which to interpolate.\n * @param {Cartesian4} result The object onto which to store the result.\n * @returns {Cartesian4} The modified result parameter.\n */\nCartesian4.lerp = function (start, end, t, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"start\", start);\n Check.typeOf.object(\"end\", end);\n Check.typeOf.number(\"t\", t);\n Check.typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n\n Cartesian4.multiplyByScalar(end, t, lerpScratch);\n result = Cartesian4.multiplyByScalar(start, 1.0 - t, result);\n return Cartesian4.add(lerpScratch, result, result);\n};\n\nconst mostOrthogonalAxisScratch = new Cartesian4();\n/**\n * Returns the axis that is most orthogonal to the provided Cartesian.\n *\n * @param {Cartesian4} cartesian The Cartesian on which to find the most orthogonal axis.\n * @param {Cartesian4} result The object onto which to store the result.\n * @returns {Cartesian4} The most orthogonal axis.\n */\nCartesian4.mostOrthogonalAxis = function (cartesian, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"cartesian\", cartesian);\n Check.typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n\n const f = Cartesian4.normalize(cartesian, mostOrthogonalAxisScratch);\n Cartesian4.abs(f, f);\n\n if (f.x <= f.y) {\n if (f.x <= f.z) {\n if (f.x <= f.w) {\n result = Cartesian4.clone(Cartesian4.UNIT_X, result);\n } else {\n result = Cartesian4.clone(Cartesian4.UNIT_W, result);\n }\n } else if (f.z <= f.w) {\n result = Cartesian4.clone(Cartesian4.UNIT_Z, result);\n } else {\n result = Cartesian4.clone(Cartesian4.UNIT_W, result);\n }\n } else if (f.y <= f.z) {\n if (f.y <= f.w) {\n result = Cartesian4.clone(Cartesian4.UNIT_Y, result);\n } else {\n result = Cartesian4.clone(Cartesian4.UNIT_W, result);\n }\n } else if (f.z <= f.w) {\n result = Cartesian4.clone(Cartesian4.UNIT_Z, result);\n } else {\n result = Cartesian4.clone(Cartesian4.UNIT_W, result);\n }\n\n return result;\n};\n\n/**\n * Compares the provided Cartesians componentwise and returns\n * true
if they are equal, false
otherwise.\n *\n * @param {Cartesian4} [left] The first Cartesian.\n * @param {Cartesian4} [right] The second Cartesian.\n * @returns {boolean} true
if left and right are equal, false
otherwise.\n */\nCartesian4.equals = function (left, right) {\n return (\n left === right ||\n (defined(left) &&\n defined(right) &&\n left.x === right.x &&\n left.y === right.y &&\n left.z === right.z &&\n left.w === right.w)\n );\n};\n\n/**\n * @private\n */\nCartesian4.equalsArray = function (cartesian, array, offset) {\n return (\n cartesian.x === array[offset] &&\n cartesian.y === array[offset + 1] &&\n cartesian.z === array[offset + 2] &&\n cartesian.w === array[offset + 3]\n );\n};\n\n/**\n * Compares the provided Cartesians componentwise and returns\n * true
if they pass an absolute or relative tolerance test,\n * false
otherwise.\n *\n * @param {Cartesian4} [left] The first Cartesian.\n * @param {Cartesian4} [right] The second Cartesian.\n * @param {number} [relativeEpsilon=0] The relative epsilon tolerance to use for equality testing.\n * @param {number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing.\n * @returns {boolean} true
if left and right are within the provided epsilon, false
otherwise.\n */\nCartesian4.equalsEpsilon = function (\n left,\n right,\n relativeEpsilon,\n absoluteEpsilon,\n) {\n return (\n left === right ||\n (defined(left) &&\n defined(right) &&\n CesiumMath.equalsEpsilon(\n left.x,\n right.x,\n relativeEpsilon,\n absoluteEpsilon,\n ) &&\n CesiumMath.equalsEpsilon(\n left.y,\n right.y,\n relativeEpsilon,\n absoluteEpsilon,\n ) &&\n CesiumMath.equalsEpsilon(\n left.z,\n right.z,\n relativeEpsilon,\n absoluteEpsilon,\n ) &&\n CesiumMath.equalsEpsilon(\n left.w,\n right.w,\n relativeEpsilon,\n absoluteEpsilon,\n ))\n );\n};\n\n/**\n * An immutable Cartesian4 instance initialized to (0.0, 0.0, 0.0, 0.0).\n *\n * @type {Cartesian4}\n * @constant\n */\nCartesian4.ZERO = Object.freeze(new Cartesian4(0.0, 0.0, 0.0, 0.0));\n\n/**\n * An immutable Cartesian4 instance initialized to (1.0, 1.0, 1.0, 1.0).\n *\n * @type {Cartesian4}\n * @constant\n */\nCartesian4.ONE = Object.freeze(new Cartesian4(1.0, 1.0, 1.0, 1.0));\n\n/**\n * An immutable Cartesian4 instance initialized to (1.0, 0.0, 0.0, 0.0).\n *\n * @type {Cartesian4}\n * @constant\n */\nCartesian4.UNIT_X = Object.freeze(new Cartesian4(1.0, 0.0, 0.0, 0.0));\n\n/**\n * An immutable Cartesian4 instance initialized to (0.0, 1.0, 0.0, 0.0).\n *\n * @type {Cartesian4}\n * @constant\n */\nCartesian4.UNIT_Y = Object.freeze(new Cartesian4(0.0, 1.0, 0.0, 0.0));\n\n/**\n * An immutable Cartesian4 instance initialized to (0.0, 0.0, 1.0, 0.0).\n *\n * @type {Cartesian4}\n * @constant\n */\nCartesian4.UNIT_Z = Object.freeze(new Cartesian4(0.0, 0.0, 1.0, 0.0));\n\n/**\n * An immutable Cartesian4 instance initialized to (0.0, 0.0, 0.0, 1.0).\n *\n * @type {Cartesian4}\n * @constant\n */\nCartesian4.UNIT_W = Object.freeze(new Cartesian4(0.0, 0.0, 0.0, 1.0));\n\n/**\n * Duplicates this Cartesian4 instance.\n *\n * @param {Cartesian4} [result] The object onto which to store the result.\n * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided.\n */\nCartesian4.prototype.clone = function (result) {\n return Cartesian4.clone(this, result);\n};\n\n/**\n * Compares this Cartesian against the provided Cartesian componentwise and returns\n * true
if they are equal, false
otherwise.\n *\n * @param {Cartesian4} [right] The right hand side Cartesian.\n * @returns {boolean} true
if they are equal, false
otherwise.\n */\nCartesian4.prototype.equals = function (right) {\n return Cartesian4.equals(this, right);\n};\n\n/**\n * Compares this Cartesian against the provided Cartesian componentwise and returns\n * true
if they pass an absolute or relative tolerance test,\n * false
otherwise.\n *\n * @param {Cartesian4} [right] The right hand side Cartesian.\n * @param {number} [relativeEpsilon=0] The relative epsilon tolerance to use for equality testing.\n * @param {number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing.\n * @returns {boolean} true
if they are within the provided epsilon, false
otherwise.\n */\nCartesian4.prototype.equalsEpsilon = function (\n right,\n relativeEpsilon,\n absoluteEpsilon,\n) {\n return Cartesian4.equalsEpsilon(\n this,\n right,\n relativeEpsilon,\n absoluteEpsilon,\n );\n};\n\n/**\n * Creates a string representing this Cartesian in the format '(x, y, z, w)'.\n *\n * @returns {string} A string representing the provided Cartesian in the format '(x, y, z, w)'.\n */\nCartesian4.prototype.toString = function () {\n return `(${this.x}, ${this.y}, ${this.z}, ${this.w})`;\n};\n\n// scratchU8Array and scratchF32Array are views into the same buffer\nconst scratchF32Array = new Float32Array(1);\nconst scratchU8Array = new Uint8Array(scratchF32Array.buffer);\n\nconst testU32 = new Uint32Array([0x11223344]);\nconst testU8 = new Uint8Array(testU32.buffer);\nconst littleEndian = testU8[0] === 0x44;\n\n/**\n * Packs an arbitrary floating point value to 4 values representable using uint8.\n *\n * @param {number} value A floating point number.\n * @param {Cartesian4} [result] The Cartesian4 that will contain the packed float.\n * @returns {Cartesian4} A Cartesian4 representing the float packed to values in x, y, z, and w.\n */\nCartesian4.packFloat = function (value, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.number(\"value\", value);\n //>>includeEnd('debug');\n\n if (!defined(result)) {\n result = new Cartesian4();\n }\n\n // scratchU8Array and scratchF32Array are views into the same buffer\n scratchF32Array[0] = value;\n\n if (littleEndian) {\n result.x = scratchU8Array[0];\n result.y = scratchU8Array[1];\n result.z = scratchU8Array[2];\n result.w = scratchU8Array[3];\n } else {\n // convert from big-endian to little-endian\n result.x = scratchU8Array[3];\n result.y = scratchU8Array[2];\n result.z = scratchU8Array[1];\n result.w = scratchU8Array[0];\n }\n return result;\n};\n\n/**\n * Unpacks a float packed using Cartesian4.packFloat.\n *\n * @param {Cartesian4} packedFloat A Cartesian4 containing a float packed to 4 values representable using uint8.\n * @returns {number} The unpacked float.\n * @private\n */\nCartesian4.unpackFloat = function (packedFloat) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"packedFloat\", packedFloat);\n //>>includeEnd('debug');\n\n // scratchU8Array and scratchF32Array are views into the same buffer\n if (littleEndian) {\n scratchU8Array[0] = packedFloat.x;\n scratchU8Array[1] = packedFloat.y;\n scratchU8Array[2] = packedFloat.z;\n scratchU8Array[3] = packedFloat.w;\n } else {\n // convert from little-endian to big-endian\n scratchU8Array[0] = packedFloat.w;\n scratchU8Array[1] = packedFloat.z;\n scratchU8Array[2] = packedFloat.y;\n scratchU8Array[3] = packedFloat.x;\n }\n return scratchF32Array[0];\n};\nexport default Cartesian4;\n","import Cartesian3 from \"./Cartesian3.js\";\nimport Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport CesiumMath from \"./Math.js\";\n\n/**\n * A 3x3 matrix, indexable as a column-major order array.\n * Constructor parameters are in row-major order for code readability.\n * @alias Matrix3\n * @constructor\n * @implements {ArrayLike\n * Returns a diagonal matrix and unitary matrix such that:\n * matrix = unitary matrix * diagonal matrix * transpose(unitary matrix)
\n *
\n * The values along the diagonal of the diagonal matrix are the eigenvalues. The columns\n * of the unitary matrix are the corresponding eigenvectors.\n *
\n *\n * @param {Matrix3} matrix The matrix to decompose into diagonal and unitary matrix. Expected to be symmetric.\n * @param {object} [result] An object with unitary and diagonal properties which are matrices onto which to store the result.\n * @returns {object} An object with unitary and diagonal properties which are the unitary and diagonal matrices, respectively.\n *\n * @example\n * const a = //... symetric matrix\n * const result = {\n * unitary : new Cesium.Matrix3(),\n * diagonal : new Cesium.Matrix3()\n * };\n * Cesium.Matrix3.computeEigenDecomposition(a, result);\n *\n * const unitaryTranspose = Cesium.Matrix3.transpose(result.unitary, new Cesium.Matrix3());\n * const b = Cesium.Matrix3.multiply(result.unitary, result.diagonal, new Cesium.Matrix3());\n * Cesium.Matrix3.multiply(b, unitaryTranspose, b); // b is now equal to a\n *\n * const lambda = Cesium.Matrix3.getColumn(result.diagonal, 0, new Cesium.Cartesian3()).x; // first eigenvalue\n * const v = Cesium.Matrix3.getColumn(result.unitary, 0, new Cesium.Cartesian3()); // first eigenvector\n * const c = Cesium.Cartesian3.multiplyByScalar(v, lambda, new Cesium.Cartesian3()); // equal to Cesium.Matrix3.multiplyByVector(a, v)\n */\nMatrix3.computeEigenDecomposition = function (matrix, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"matrix\", matrix);\n //>>includeEnd('debug');\n\n // This routine was created based upon Matrix Computations, 3rd ed., by Golub and Van Loan,\n // section 8.4.3 The Classical Jacobi Algorithm\n\n const tolerance = CesiumMath.EPSILON20;\n const maxSweeps = 10;\n\n let count = 0;\n let sweep = 0;\n\n if (!defined(result)) {\n result = {};\n }\n\n const unitaryMatrix = (result.unitary = Matrix3.clone(\n Matrix3.IDENTITY,\n result.unitary,\n ));\n const diagMatrix = (result.diagonal = Matrix3.clone(matrix, result.diagonal));\n\n const epsilon = tolerance * computeFrobeniusNorm(diagMatrix);\n\n while (sweep < maxSweeps && offDiagonalFrobeniusNorm(diagMatrix) > epsilon) {\n shurDecomposition(diagMatrix, jMatrix);\n Matrix3.transpose(jMatrix, jMatrixTranspose);\n Matrix3.multiply(diagMatrix, jMatrix, diagMatrix);\n Matrix3.multiply(jMatrixTranspose, diagMatrix, diagMatrix);\n Matrix3.multiply(unitaryMatrix, jMatrix, unitaryMatrix);\n\n if (++count > 2) {\n ++sweep;\n count = 0;\n }\n }\n\n return result;\n};\n\n/**\n * Computes a matrix, which contains the absolute (unsigned) values of the provided matrix's elements.\n *\n * @param {Matrix3} matrix The matrix with signed elements.\n * @param {Matrix3} result The object onto which to store the result.\n * @returns {Matrix3} The modified result parameter.\n */\nMatrix3.abs = function (matrix, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"matrix\", matrix);\n Check.typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n\n result[0] = Math.abs(matrix[0]);\n result[1] = Math.abs(matrix[1]);\n result[2] = Math.abs(matrix[2]);\n result[3] = Math.abs(matrix[3]);\n result[4] = Math.abs(matrix[4]);\n result[5] = Math.abs(matrix[5]);\n result[6] = Math.abs(matrix[6]);\n result[7] = Math.abs(matrix[7]);\n result[8] = Math.abs(matrix[8]);\n\n return result;\n};\n\n/**\n * Computes the determinant of the provided matrix.\n *\n * @param {Matrix3} matrix The matrix to use.\n * @returns {number} The value of the determinant of the matrix.\n */\nMatrix3.determinant = function (matrix) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"matrix\", matrix);\n //>>includeEnd('debug');\n\n const m11 = matrix[0];\n const m21 = matrix[3];\n const m31 = matrix[6];\n const m12 = matrix[1];\n const m22 = matrix[4];\n const m32 = matrix[7];\n const m13 = matrix[2];\n const m23 = matrix[5];\n const m33 = matrix[8];\n\n return (\n m11 * (m22 * m33 - m23 * m32) +\n m12 * (m23 * m31 - m21 * m33) +\n m13 * (m21 * m32 - m22 * m31)\n );\n};\n\n/**\n * Computes the inverse of the provided matrix.\n *\n * @param {Matrix3} matrix The matrix to invert.\n * @param {Matrix3} result The object onto which to store the result.\n * @returns {Matrix3} The modified result parameter.\n *\n * @exception {DeveloperError} matrix is not invertible.\n */\nMatrix3.inverse = function (matrix, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"matrix\", matrix);\n Check.typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n\n const m11 = matrix[0];\n const m21 = matrix[1];\n const m31 = matrix[2];\n const m12 = matrix[3];\n const m22 = matrix[4];\n const m32 = matrix[5];\n const m13 = matrix[6];\n const m23 = matrix[7];\n const m33 = matrix[8];\n\n const determinant = Matrix3.determinant(matrix);\n\n //>>includeStart('debug', pragmas.debug);\n if (Math.abs(determinant) <= CesiumMath.EPSILON15) {\n throw new DeveloperError(\"matrix is not invertible\");\n }\n //>>includeEnd('debug');\n\n result[0] = m22 * m33 - m23 * m32;\n result[1] = m23 * m31 - m21 * m33;\n result[2] = m21 * m32 - m22 * m31;\n result[3] = m13 * m32 - m12 * m33;\n result[4] = m11 * m33 - m13 * m31;\n result[5] = m12 * m31 - m11 * m32;\n result[6] = m12 * m23 - m13 * m22;\n result[7] = m13 * m21 - m11 * m23;\n result[8] = m11 * m22 - m12 * m21;\n\n const scale = 1.0 / determinant;\n return Matrix3.multiplyByScalar(result, scale, result);\n};\n\nconst scratchTransposeMatrix = new Matrix3();\n\n/**\n * Computes the inverse transpose of a matrix.\n *\n * @param {Matrix3} matrix The matrix to transpose and invert.\n * @param {Matrix3} result The object onto which to store the result.\n * @returns {Matrix3} The modified result parameter.\n */\nMatrix3.inverseTranspose = function (matrix, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"matrix\", matrix);\n Check.typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n\n return Matrix3.inverse(\n Matrix3.transpose(matrix, scratchTransposeMatrix),\n result,\n );\n};\n\n/**\n * Compares the provided matrices componentwise and returns\n *true
if they are equal, false
otherwise.\n *\n * @param {Matrix3} [left] The first matrix.\n * @param {Matrix3} [right] The second matrix.\n * @returns {boolean} true
if left and right are equal, false
otherwise.\n */\nMatrix3.equals = function (left, right) {\n return (\n left === right ||\n (defined(left) &&\n defined(right) &&\n left[0] === right[0] &&\n left[1] === right[1] &&\n left[2] === right[2] &&\n left[3] === right[3] &&\n left[4] === right[4] &&\n left[5] === right[5] &&\n left[6] === right[6] &&\n left[7] === right[7] &&\n left[8] === right[8])\n );\n};\n\n/**\n * Compares the provided matrices componentwise and returns\n * true
if they are within the provided epsilon,\n * false
otherwise.\n *\n * @param {Matrix3} [left] The first matrix.\n * @param {Matrix3} [right] The second matrix.\n * @param {number} [epsilon=0] The epsilon to use for equality testing.\n * @returns {boolean} true
if left and right are within the provided epsilon, false
otherwise.\n */\nMatrix3.equalsEpsilon = function (left, right, epsilon) {\n epsilon = defaultValue(epsilon, 0);\n\n return (\n left === right ||\n (defined(left) &&\n defined(right) &&\n Math.abs(left[0] - right[0]) <= epsilon &&\n Math.abs(left[1] - right[1]) <= epsilon &&\n Math.abs(left[2] - right[2]) <= epsilon &&\n Math.abs(left[3] - right[3]) <= epsilon &&\n Math.abs(left[4] - right[4]) <= epsilon &&\n Math.abs(left[5] - right[5]) <= epsilon &&\n Math.abs(left[6] - right[6]) <= epsilon &&\n Math.abs(left[7] - right[7]) <= epsilon &&\n Math.abs(left[8] - right[8]) <= epsilon)\n );\n};\n\n/**\n * An immutable Matrix3 instance initialized to the identity matrix.\n *\n * @type {Matrix3}\n * @constant\n */\nMatrix3.IDENTITY = Object.freeze(\n new Matrix3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0),\n);\n\n/**\n * An immutable Matrix3 instance initialized to the zero matrix.\n *\n * @type {Matrix3}\n * @constant\n */\nMatrix3.ZERO = Object.freeze(\n new Matrix3(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0),\n);\n\n/**\n * The index into Matrix3 for column 0, row 0.\n *\n * @type {number}\n * @constant\n */\nMatrix3.COLUMN0ROW0 = 0;\n\n/**\n * The index into Matrix3 for column 0, row 1.\n *\n * @type {number}\n * @constant\n */\nMatrix3.COLUMN0ROW1 = 1;\n\n/**\n * The index into Matrix3 for column 0, row 2.\n *\n * @type {number}\n * @constant\n */\nMatrix3.COLUMN0ROW2 = 2;\n\n/**\n * The index into Matrix3 for column 1, row 0.\n *\n * @type {number}\n * @constant\n */\nMatrix3.COLUMN1ROW0 = 3;\n\n/**\n * The index into Matrix3 for column 1, row 1.\n *\n * @type {number}\n * @constant\n */\nMatrix3.COLUMN1ROW1 = 4;\n\n/**\n * The index into Matrix3 for column 1, row 2.\n *\n * @type {number}\n * @constant\n */\nMatrix3.COLUMN1ROW2 = 5;\n\n/**\n * The index into Matrix3 for column 2, row 0.\n *\n * @type {number}\n * @constant\n */\nMatrix3.COLUMN2ROW0 = 6;\n\n/**\n * The index into Matrix3 for column 2, row 1.\n *\n * @type {number}\n * @constant\n */\nMatrix3.COLUMN2ROW1 = 7;\n\n/**\n * The index into Matrix3 for column 2, row 2.\n *\n * @type {number}\n * @constant\n */\nMatrix3.COLUMN2ROW2 = 8;\n\nObject.defineProperties(Matrix3.prototype, {\n /**\n * Gets the number of items in the collection.\n * @memberof Matrix3.prototype\n *\n * @type {number}\n */\n length: {\n get: function () {\n return Matrix3.packedLength;\n },\n },\n});\n\n/**\n * Duplicates the provided Matrix3 instance.\n *\n * @param {Matrix3} [result] The object onto which to store the result.\n * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if one was not provided.\n */\nMatrix3.prototype.clone = function (result) {\n return Matrix3.clone(this, result);\n};\n\n/**\n * Compares this matrix to the provided matrix componentwise and returns\n * true
if they are equal, false
otherwise.\n *\n * @param {Matrix3} [right] The right hand side matrix.\n * @returns {boolean} true
if they are equal, false
otherwise.\n */\nMatrix3.prototype.equals = function (right) {\n return Matrix3.equals(this, right);\n};\n\n/**\n * @private\n */\nMatrix3.equalsArray = function (matrix, array, offset) {\n return (\n matrix[0] === array[offset] &&\n matrix[1] === array[offset + 1] &&\n matrix[2] === array[offset + 2] &&\n matrix[3] === array[offset + 3] &&\n matrix[4] === array[offset + 4] &&\n matrix[5] === array[offset + 5] &&\n matrix[6] === array[offset + 6] &&\n matrix[7] === array[offset + 7] &&\n matrix[8] === array[offset + 8]\n );\n};\n\n/**\n * Compares this matrix to the provided matrix componentwise and returns\n * true
if they are within the provided epsilon,\n * false
otherwise.\n *\n * @param {Matrix3} [right] The right hand side matrix.\n * @param {number} [epsilon=0] The epsilon to use for equality testing.\n * @returns {boolean} true
if they are within the provided epsilon, false
otherwise.\n */\nMatrix3.prototype.equalsEpsilon = function (right, epsilon) {\n return Matrix3.equalsEpsilon(this, right, epsilon);\n};\n\n/**\n * Creates a string representing this Matrix with each row being\n * on a separate line and in the format '(column0, column1, column2)'.\n *\n * @returns {string} A string representing the provided Matrix with each row being on a separate line and in the format '(column0, column1, column2)'.\n */\nMatrix3.prototype.toString = function () {\n return (\n `(${this[0]}, ${this[3]}, ${this[6]})\\n` +\n `(${this[1]}, ${this[4]}, ${this[7]})\\n` +\n `(${this[2]}, ${this[5]}, ${this[8]})`\n );\n};\nexport default Matrix3;\n","import defined from \"./defined.js\";\n\n/**\n * Constructs an exception object that is thrown due to an error that can occur at runtime, e.g.,\n * out of memory, could not compile shader, etc. If a function may throw this\n * exception, the calling code should be prepared to catch it.\n * x
axis points in the local east direction.y
axis points in the local north direction.z
axis points in the direction of the ellipsoid surface normal which passes through the position.x
axis points in the local north direction.y
axis points in the local east direction.z
axis points in the opposite direction of the ellipsoid surface normal which passes through the position.x
axis points in the local north direction.y
axis points in the direction of the ellipsoid surface normal which passes through the position.z
axis points in the local east direction.x
axis points in the local north direction.y
axis points in the local west direction.z
axis points in the direction of the ellipsoid surface normal which passes through the position.itemToFind
in the array, if it exists. If itemToFind
\n * does not exist, the return value is a negative number which is the bitwise complement (~)\n * of the index before which the itemToFind should be inserted in order to maintain the\n * sorted order of the array.\n *\n * @example\n * // Create a comparator function to search through an array of numbers.\n * function comparator(a, b) {\n * return a - b;\n * };\n * const numbers = [0, 2, 4, 6, 8];\n * const index = Cesium.binarySearch(numbers, 6, comparator); // 3\n */\nfunction binarySearch(array, itemToFind, comparator) {\n //>>includeStart('debug', pragmas.debug);\n Check.defined(\"array\", array);\n Check.defined(\"itemToFind\", itemToFind);\n Check.defined(\"comparator\", comparator);\n //>>includeEnd('debug');\n\n let low = 0;\n let high = array.length - 1;\n let i;\n let comparison;\n\n while (low <= high) {\n i = ~~((low + high) / 2);\n comparison = comparator(array[i], itemToFind);\n if (comparison < 0) {\n low = i + 1;\n continue;\n }\n if (comparison > 0) {\n high = i - 1;\n continue;\n }\n return i;\n }\n return ~(high + 1);\n}\n\n/**\n * A function used to compare two items while performing a binary search.\n * @callback binarySearchComparator\n *\n * @param {*} a An item in the array.\n * @param {*} b The item being searched for.\n * @returns {number} Returns a negative value if a
is less than b
,\n * a positive value if a
is greater than b
, or\n * 0 if a
is equal to b
.\n *\n * @example\n * function compareNumbers(a, b) {\n * return a - b;\n * }\n */\nexport default binarySearch;\n","/**\n * A set of Earth Orientation Parameters (EOP) sampled at a time.\n *\n * @alias EarthOrientationParametersSample\n * @constructor\n *\n * @param {number} xPoleWander The pole wander about the X axis, in radians.\n * @param {number} yPoleWander The pole wander about the Y axis, in radians.\n * @param {number} xPoleOffset The offset to the Celestial Intermediate Pole (CIP) about the X axis, in radians.\n * @param {number} yPoleOffset The offset to the Celestial Intermediate Pole (CIP) about the Y axis, in radians.\n * @param {number} ut1MinusUtc The difference in time standards, UT1 - UTC, in seconds.\n *\n * @private\n */\nfunction EarthOrientationParametersSample(\n xPoleWander,\n yPoleWander,\n xPoleOffset,\n yPoleOffset,\n ut1MinusUtc,\n) {\n /**\n * The pole wander about the X axis, in radians.\n * @type {number}\n */\n this.xPoleWander = xPoleWander;\n\n /**\n * The pole wander about the Y axis, in radians.\n * @type {number}\n */\n this.yPoleWander = yPoleWander;\n\n /**\n * The offset to the Celestial Intermediate Pole (CIP) about the X axis, in radians.\n * @type {number}\n */\n this.xPoleOffset = xPoleOffset;\n\n /**\n * The offset to the Celestial Intermediate Pole (CIP) about the Y axis, in radians.\n * @type {number}\n */\n this.yPoleOffset = yPoleOffset;\n\n /**\n * The difference in time standards, UT1 - UTC, in seconds.\n * @type {number}\n */\n this.ut1MinusUtc = ut1MinusUtc;\n}\nexport default EarthOrientationParametersSample;\n","import binarySearch from \"./binarySearch.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport GregorianDate from \"./GregorianDate.js\";\nimport isLeapYear from \"./isLeapYear.js\";\nimport LeapSecond from \"./LeapSecond.js\";\nimport TimeConstants from \"./TimeConstants.js\";\nimport TimeStandard from \"./TimeStandard.js\";\n\nconst gregorianDateScratch = new GregorianDate();\nconst daysInMonth = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\nconst daysInLeapFeburary = 29;\n\nfunction compareLeapSecondDates(leapSecond, dateToFind) {\n return JulianDate.compare(leapSecond.julianDate, dateToFind.julianDate);\n}\n\n// we don't really need a leap second instance, anything with a julianDate property will do\nconst binarySearchScratchLeapSecond = new LeapSecond();\n\nfunction convertUtcToTai(julianDate) {\n //Even though julianDate is in UTC, we'll treat it as TAI and\n //search the leap second table for it.\n binarySearchScratchLeapSecond.julianDate = julianDate;\n const leapSeconds = JulianDate.leapSeconds;\n let index = binarySearch(\n leapSeconds,\n binarySearchScratchLeapSecond,\n compareLeapSecondDates,\n );\n\n if (index < 0) {\n index = ~index;\n }\n\n if (index >= leapSeconds.length) {\n index = leapSeconds.length - 1;\n }\n\n let offset = leapSeconds[index].offset;\n if (index > 0) {\n //Now we have the index of the closest leap second that comes on or after our UTC time.\n //However, if the difference between the UTC date being converted and the TAI\n //defined leap second is greater than the offset, we are off by one and need to use\n //the previous leap second.\n const difference = JulianDate.secondsDifference(\n leapSeconds[index].julianDate,\n julianDate,\n );\n if (difference > offset) {\n index--;\n offset = leapSeconds[index].offset;\n }\n }\n\n JulianDate.addSeconds(julianDate, offset, julianDate);\n}\n\nfunction convertTaiToUtc(julianDate, result) {\n binarySearchScratchLeapSecond.julianDate = julianDate;\n const leapSeconds = JulianDate.leapSeconds;\n let index = binarySearch(\n leapSeconds,\n binarySearchScratchLeapSecond,\n compareLeapSecondDates,\n );\n if (index < 0) {\n index = ~index;\n }\n\n //All times before our first leap second get the first offset.\n if (index === 0) {\n return JulianDate.addSeconds(julianDate, -leapSeconds[0].offset, result);\n }\n\n //All times after our leap second get the last offset.\n if (index >= leapSeconds.length) {\n return JulianDate.addSeconds(\n julianDate,\n -leapSeconds[index - 1].offset,\n result,\n );\n }\n\n //Compute the difference between the found leap second and the time we are converting.\n const difference = JulianDate.secondsDifference(\n leapSeconds[index].julianDate,\n julianDate,\n );\n\n if (difference === 0) {\n //The date is in our leap second table.\n return JulianDate.addSeconds(\n julianDate,\n -leapSeconds[index].offset,\n result,\n );\n }\n\n if (difference <= 1.0) {\n //The requested date is during the moment of a leap second, then we cannot convert to UTC\n return undefined;\n }\n\n //The time is in between two leap seconds, index is the leap second after the date\n //we're converting, so we subtract one to get the correct LeapSecond instance.\n return JulianDate.addSeconds(\n julianDate,\n -leapSeconds[--index].offset,\n result,\n );\n}\n\nfunction setComponents(wholeDays, secondsOfDay, julianDate) {\n const extraDays = (secondsOfDay / TimeConstants.SECONDS_PER_DAY) | 0;\n wholeDays += extraDays;\n secondsOfDay -= TimeConstants.SECONDS_PER_DAY * extraDays;\n\n if (secondsOfDay < 0) {\n wholeDays--;\n secondsOfDay += TimeConstants.SECONDS_PER_DAY;\n }\n\n julianDate.dayNumber = wholeDays;\n julianDate.secondsOfDay = secondsOfDay;\n return julianDate;\n}\n\nfunction computeJulianDateComponents(\n year,\n month,\n day,\n hour,\n minute,\n second,\n millisecond,\n) {\n // Algorithm from page 604 of the Explanatory Supplement to the\n // Astronomical Almanac (Seidelmann 1992).\n\n const a = ((month - 14) / 12) | 0;\n const b = year + 4800 + a;\n let dayNumber =\n (((1461 * b) / 4) | 0) +\n (((367 * (month - 2 - 12 * a)) / 12) | 0) -\n (((3 * (((b + 100) / 100) | 0)) / 4) | 0) +\n day -\n 32075;\n\n // JulianDates are noon-based\n hour = hour - 12;\n if (hour < 0) {\n hour += 24;\n }\n\n const secondsOfDay =\n second +\n (hour * TimeConstants.SECONDS_PER_HOUR +\n minute * TimeConstants.SECONDS_PER_MINUTE +\n millisecond * TimeConstants.SECONDS_PER_MILLISECOND);\n\n if (secondsOfDay >= 43200.0) {\n dayNumber -= 1;\n }\n\n return [dayNumber, secondsOfDay];\n}\n\n//Regular expressions used for ISO8601 date parsing.\n//YYYY\nconst matchCalendarYear = /^(\\d{4})$/;\n//YYYY-MM (YYYYMM is invalid)\nconst matchCalendarMonth = /^(\\d{4})-(\\d{2})$/;\n//YYYY-DDD or YYYYDDD\nconst matchOrdinalDate = /^(\\d{4})-?(\\d{3})$/;\n//YYYY-Www or YYYYWww or YYYY-Www-D or YYYYWwwD\nconst matchWeekDate = /^(\\d{4})-?W(\\d{2})-?(\\d{1})?$/;\n//YYYY-MM-DD or YYYYMMDD\nconst matchCalendarDate = /^(\\d{4})-?(\\d{2})-?(\\d{2})$/;\n// Match utc offset\nconst utcOffset = /([Z+\\-])?(\\d{2})?:?(\\d{2})?$/;\n// Match hours HH or HH.xxxxx\nconst matchHours = /^(\\d{2})(\\.\\d+)?/.source + utcOffset.source;\n// Match hours/minutes HH:MM HHMM.xxxxx\nconst matchHoursMinutes = /^(\\d{2}):?(\\d{2})(\\.\\d+)?/.source + utcOffset.source;\n// Match hours/minutes HH:MM:SS HHMMSS.xxxxx\nconst matchHoursMinutesSeconds =\n /^(\\d{2}):?(\\d{2}):?(\\d{2})(\\.\\d+)?/.source + utcOffset.source;\n\nconst iso8601ErrorMessage = \"Invalid ISO 8601 date.\";\n\n/**\n * Represents an astronomical Julian date, which is the number of days since noon on January 1, -4712 (4713 BC).\n * For increased precision, this class stores the whole number part of the date and the seconds\n * part of the date in separate components. In order to be safe for arithmetic and represent\n * leap seconds, the date is always stored in the International Atomic Time standard\n * {@link TimeStandard.TAI}.\n * @alias JulianDate\n * @constructor\n *\n * @param {number} [julianDayNumber=0.0] The Julian Day Number representing the number of whole days. Fractional days will also be handled correctly.\n * @param {number} [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.\n * @param {TimeStandard} [timeStandard=TimeStandard.UTC] The time standard in which the first two parameters are defined.\n */\nfunction JulianDate(julianDayNumber, secondsOfDay, timeStandard) {\n /**\n * Gets or sets the number of whole days.\n * @type {number}\n */\n this.dayNumber = undefined;\n\n /**\n * Gets or sets the number of seconds into the current day.\n * @type {number}\n */\n this.secondsOfDay = undefined;\n\n julianDayNumber = defaultValue(julianDayNumber, 0.0);\n secondsOfDay = defaultValue(secondsOfDay, 0.0);\n timeStandard = defaultValue(timeStandard, TimeStandard.UTC);\n\n //If julianDayNumber is fractional, make it an integer and add the number of seconds the fraction represented.\n const wholeDays = julianDayNumber | 0;\n secondsOfDay =\n secondsOfDay +\n (julianDayNumber - wholeDays) * TimeConstants.SECONDS_PER_DAY;\n\n setComponents(wholeDays, secondsOfDay, this);\n\n if (timeStandard === TimeStandard.UTC) {\n convertUtcToTai(this);\n }\n}\n\n/**\n * Creates a new instance from a GregorianDate.\n *\n * @param {GregorianDate} date A GregorianDate.\n * @param {JulianDate} [result] An existing instance to use for the result.\n * @returns {JulianDate} The modified result parameter or a new instance if none was provided.\n *\n * @exception {DeveloperError} date must be a valid GregorianDate.\n */\nJulianDate.fromGregorianDate = function (date, result) {\n //>>includeStart('debug', pragmas.debug);\n if (!(date instanceof GregorianDate)) {\n throw new DeveloperError(\"date must be a valid GregorianDate.\");\n }\n //>>includeEnd('debug');\n\n const components = computeJulianDateComponents(\n date.year,\n date.month,\n date.day,\n date.hour,\n date.minute,\n date.second,\n date.millisecond,\n );\n if (!defined(result)) {\n return new JulianDate(components[0], components[1], TimeStandard.UTC);\n }\n setComponents(components[0], components[1], result);\n convertUtcToTai(result);\n return result;\n};\n\n/**\n * Creates a new instance from a JavaScript Date.\n *\n * @param {Date} date A JavaScript Date.\n * @param {JulianDate} [result] An existing instance to use for the result.\n * @returns {JulianDate} The modified result parameter or a new instance if none was provided.\n *\n * @exception {DeveloperError} date must be a valid JavaScript Date.\n */\nJulianDate.fromDate = function (date, result) {\n //>>includeStart('debug', pragmas.debug);\n if (!(date instanceof Date) || isNaN(date.getTime())) {\n throw new DeveloperError(\"date must be a valid JavaScript Date.\");\n }\n //>>includeEnd('debug');\n\n const components = computeJulianDateComponents(\n date.getUTCFullYear(),\n date.getUTCMonth() + 1,\n date.getUTCDate(),\n date.getUTCHours(),\n date.getUTCMinutes(),\n date.getUTCSeconds(),\n date.getUTCMilliseconds(),\n );\n if (!defined(result)) {\n return new JulianDate(components[0], components[1], TimeStandard.UTC);\n }\n setComponents(components[0], components[1], result);\n convertUtcToTai(result);\n return result;\n};\n\n/**\n * Creates a new instance from a from an {@link http://en.wikipedia.org/wiki/ISO_8601|ISO 8601} date.\n * This method is superior to Date.parse
because it will handle all valid formats defined by the ISO 8601\n * specification, including leap seconds and sub-millisecond times, which discarded by most JavaScript implementations.\n *\n * @param {string} iso8601String An ISO 8601 date.\n * @param {JulianDate} [result] An existing instance to use for the result.\n * @returns {JulianDate} The modified result parameter or a new instance if none was provided.\n *\n * @exception {DeveloperError} Invalid ISO 8601 date.\n */\nJulianDate.fromIso8601 = function (iso8601String, result) {\n //>>includeStart('debug', pragmas.debug);\n if (typeof iso8601String !== \"string\") {\n throw new DeveloperError(iso8601ErrorMessage);\n }\n //>>includeEnd('debug');\n\n //Comma and decimal point both indicate a fractional number according to ISO 8601,\n //start out by blanket replacing , with . which is the only valid such symbol in JS.\n iso8601String = iso8601String.replace(\",\", \".\");\n\n //Split the string into its date and time components, denoted by a mandatory T\n let tokens = iso8601String.split(\"T\");\n let year;\n let month = 1;\n let day = 1;\n let hour = 0;\n let minute = 0;\n let second = 0;\n let millisecond = 0;\n\n //Lacking a time is okay, but a missing date is illegal.\n const date = tokens[0];\n const time = tokens[1];\n let tmp;\n let inLeapYear;\n //>>includeStart('debug', pragmas.debug);\n if (!defined(date)) {\n throw new DeveloperError(iso8601ErrorMessage);\n }\n\n let dashCount;\n //>>includeEnd('debug');\n\n //First match the date against possible regular expressions.\n tokens = date.match(matchCalendarDate);\n if (tokens !== null) {\n //>>includeStart('debug', pragmas.debug);\n dashCount = date.split(\"-\").length - 1;\n if (dashCount > 0 && dashCount !== 2) {\n throw new DeveloperError(iso8601ErrorMessage);\n }\n //>>includeEnd('debug');\n year = +tokens[1];\n month = +tokens[2];\n day = +tokens[3];\n } else {\n tokens = date.match(matchCalendarMonth);\n if (tokens !== null) {\n year = +tokens[1];\n month = +tokens[2];\n } else {\n tokens = date.match(matchCalendarYear);\n if (tokens !== null) {\n year = +tokens[1];\n } else {\n //Not a year/month/day so it must be an ordinal date.\n let dayOfYear;\n tokens = date.match(matchOrdinalDate);\n if (tokens !== null) {\n year = +tokens[1];\n dayOfYear = +tokens[2];\n inLeapYear = isLeapYear(year);\n\n //This validation is only applicable for this format.\n //>>includeStart('debug', pragmas.debug);\n if (\n dayOfYear < 1 ||\n (inLeapYear && dayOfYear > 366) ||\n (!inLeapYear && dayOfYear > 365)\n ) {\n throw new DeveloperError(iso8601ErrorMessage);\n }\n //>>includeEnd('debug')\n } else {\n tokens = date.match(matchWeekDate);\n if (tokens !== null) {\n //ISO week date to ordinal date from\n //http://en.wikipedia.org/w/index.php?title=ISO_week_date&oldid=474176775\n year = +tokens[1];\n const weekNumber = +tokens[2];\n const dayOfWeek = +tokens[3] || 0;\n\n //>>includeStart('debug', pragmas.debug);\n dashCount = date.split(\"-\").length - 1;\n if (\n dashCount > 0 &&\n ((!defined(tokens[3]) && dashCount !== 1) ||\n (defined(tokens[3]) && dashCount !== 2))\n ) {\n throw new DeveloperError(iso8601ErrorMessage);\n }\n //>>includeEnd('debug')\n\n const january4 = new Date(Date.UTC(year, 0, 4));\n dayOfYear = weekNumber * 7 + dayOfWeek - january4.getUTCDay() - 3;\n } else {\n //None of our regular expressions succeeded in parsing the date properly.\n //>>includeStart('debug', pragmas.debug);\n throw new DeveloperError(iso8601ErrorMessage);\n //>>includeEnd('debug')\n }\n }\n //Split an ordinal date into month/day.\n tmp = new Date(Date.UTC(year, 0, 1));\n tmp.setUTCDate(dayOfYear);\n month = tmp.getUTCMonth() + 1;\n day = tmp.getUTCDate();\n }\n }\n }\n\n //Now that we have all of the date components, validate them to make sure nothing is out of range.\n inLeapYear = isLeapYear(year);\n //>>includeStart('debug', pragmas.debug);\n if (\n month < 1 ||\n month > 12 ||\n day < 1 ||\n ((month !== 2 || !inLeapYear) && day > daysInMonth[month - 1]) ||\n (inLeapYear && month === 2 && day > daysInLeapFeburary)\n ) {\n throw new DeveloperError(iso8601ErrorMessage);\n }\n //>>includeEnd('debug')\n\n //Now move onto the time string, which is much simpler.\n //If no time is specified, it is considered the beginning of the day, UTC to match Javascript's implementation.\n let offsetIndex;\n if (defined(time)) {\n tokens = time.match(matchHoursMinutesSeconds);\n if (tokens !== null) {\n //>>includeStart('debug', pragmas.debug);\n dashCount = time.split(\":\").length - 1;\n if (dashCount > 0 && dashCount !== 2 && dashCount !== 3) {\n throw new DeveloperError(iso8601ErrorMessage);\n }\n //>>includeEnd('debug')\n\n hour = +tokens[1];\n minute = +tokens[2];\n second = +tokens[3];\n millisecond = +(tokens[4] || 0) * 1000.0;\n offsetIndex = 5;\n } else {\n tokens = time.match(matchHoursMinutes);\n if (tokens !== null) {\n //>>includeStart('debug', pragmas.debug);\n dashCount = time.split(\":\").length - 1;\n if (dashCount > 2) {\n throw new DeveloperError(iso8601ErrorMessage);\n }\n //>>includeEnd('debug')\n\n hour = +tokens[1];\n minute = +tokens[2];\n second = +(tokens[3] || 0) * 60.0;\n offsetIndex = 4;\n } else {\n tokens = time.match(matchHours);\n if (tokens !== null) {\n hour = +tokens[1];\n minute = +(tokens[2] || 0) * 60.0;\n offsetIndex = 3;\n } else {\n //>>includeStart('debug', pragmas.debug);\n throw new DeveloperError(iso8601ErrorMessage);\n //>>includeEnd('debug')\n }\n }\n }\n\n //Validate that all values are in proper range. Minutes and hours have special cases at 60 and 24.\n //>>includeStart('debug', pragmas.debug);\n if (\n minute >= 60 ||\n second >= 61 ||\n hour > 24 ||\n (hour === 24 && (minute > 0 || second > 0 || millisecond > 0))\n ) {\n throw new DeveloperError(iso8601ErrorMessage);\n }\n //>>includeEnd('debug');\n\n //Check the UTC offset value, if no value exists, use local time\n //a Z indicates UTC, + or - are offsets.\n const offset = tokens[offsetIndex];\n const offsetHours = +tokens[offsetIndex + 1];\n const offsetMinutes = +(tokens[offsetIndex + 2] || 0);\n switch (offset) {\n case \"+\":\n hour = hour - offsetHours;\n minute = minute - offsetMinutes;\n break;\n case \"-\":\n hour = hour + offsetHours;\n minute = minute + offsetMinutes;\n break;\n case \"Z\":\n break;\n default:\n minute =\n minute +\n new Date(\n Date.UTC(year, month - 1, day, hour, minute),\n ).getTimezoneOffset();\n break;\n }\n }\n\n //ISO8601 denotes a leap second by any time having a seconds component of 60 seconds.\n //If that's the case, we need to temporarily subtract a second in order to build a UTC date.\n //Then we add it back in after converting to TAI.\n const isLeapSecond = second === 60;\n if (isLeapSecond) {\n second--;\n }\n\n //Even if we successfully parsed the string into its components, after applying UTC offset or\n //special cases like 24:00:00 denoting midnight, we need to normalize the data appropriately.\n\n //milliseconds can never be greater than 1000, and seconds can't be above 60, so we start with minutes\n while (minute >= 60) {\n minute -= 60;\n hour++;\n }\n\n while (hour >= 24) {\n hour -= 24;\n day++;\n }\n\n tmp = inLeapYear && month === 2 ? daysInLeapFeburary : daysInMonth[month - 1];\n while (day > tmp) {\n day -= tmp;\n month++;\n\n if (month > 12) {\n month -= 12;\n year++;\n }\n\n tmp =\n inLeapYear && month === 2 ? daysInLeapFeburary : daysInMonth[month - 1];\n }\n\n //If UTC offset is at the beginning/end of the day, minutes can be negative.\n while (minute < 0) {\n minute += 60;\n hour--;\n }\n\n while (hour < 0) {\n hour += 24;\n day--;\n }\n\n while (day < 1) {\n month--;\n if (month < 1) {\n month += 12;\n year--;\n }\n\n tmp =\n inLeapYear && month === 2 ? daysInLeapFeburary : daysInMonth[month - 1];\n day += tmp;\n }\n\n //Now create the JulianDate components from the Gregorian date and actually create our instance.\n const components = computeJulianDateComponents(\n year,\n month,\n day,\n hour,\n minute,\n second,\n millisecond,\n );\n\n if (!defined(result)) {\n result = new JulianDate(components[0], components[1], TimeStandard.UTC);\n } else {\n setComponents(components[0], components[1], result);\n convertUtcToTai(result);\n }\n\n //If we were on a leap second, add it back.\n if (isLeapSecond) {\n JulianDate.addSeconds(result, 1, result);\n }\n\n return result;\n};\n\n/**\n * Creates a new instance that represents the current system time.\n * This is equivalent to calling JulianDate.fromDate(new Date());
.\n *\n * @param {JulianDate} [result] An existing instance to use for the result.\n * @returns {JulianDate} The modified result parameter or a new instance if none was provided.\n */\nJulianDate.now = function (result) {\n return JulianDate.fromDate(new Date(), result);\n};\n\nconst toGregorianDateScratch = new JulianDate(0, 0, TimeStandard.TAI);\n\n/**\n * Creates a {@link GregorianDate} from the provided instance.\n *\n * @param {JulianDate} julianDate The date to be converted.\n * @param {GregorianDate} [result] An existing instance to use for the result.\n * @returns {GregorianDate} The modified result parameter or a new instance if none was provided.\n */\nJulianDate.toGregorianDate = function (julianDate, result) {\n //>>includeStart('debug', pragmas.debug);\n if (!defined(julianDate)) {\n throw new DeveloperError(\"julianDate is required.\");\n }\n //>>includeEnd('debug');\n\n let isLeapSecond = false;\n let thisUtc = convertTaiToUtc(julianDate, toGregorianDateScratch);\n if (!defined(thisUtc)) {\n //Conversion to UTC will fail if we are during a leap second.\n //If that's the case, subtract a second and convert again.\n //JavaScript doesn't support leap seconds, so this results in second 59 being repeated twice.\n JulianDate.addSeconds(julianDate, -1, toGregorianDateScratch);\n thisUtc = convertTaiToUtc(toGregorianDateScratch, toGregorianDateScratch);\n isLeapSecond = true;\n }\n\n let julianDayNumber = thisUtc.dayNumber;\n const secondsOfDay = thisUtc.secondsOfDay;\n\n if (secondsOfDay >= 43200.0) {\n julianDayNumber += 1;\n }\n\n // Algorithm from page 604 of the Explanatory Supplement to the\n // Astronomical Almanac (Seidelmann 1992).\n let L = (julianDayNumber + 68569) | 0;\n const N = ((4 * L) / 146097) | 0;\n L = (L - (((146097 * N + 3) / 4) | 0)) | 0;\n const I = ((4000 * (L + 1)) / 1461001) | 0;\n L = (L - (((1461 * I) / 4) | 0) + 31) | 0;\n const J = ((80 * L) / 2447) | 0;\n const day = (L - (((2447 * J) / 80) | 0)) | 0;\n L = (J / 11) | 0;\n const month = (J + 2 - 12 * L) | 0;\n const year = (100 * (N - 49) + I + L) | 0;\n\n let hour = (secondsOfDay / TimeConstants.SECONDS_PER_HOUR) | 0;\n let remainingSeconds = secondsOfDay - hour * TimeConstants.SECONDS_PER_HOUR;\n const minute = (remainingSeconds / TimeConstants.SECONDS_PER_MINUTE) | 0;\n remainingSeconds =\n remainingSeconds - minute * TimeConstants.SECONDS_PER_MINUTE;\n let second = remainingSeconds | 0;\n const millisecond =\n (remainingSeconds - second) / TimeConstants.SECONDS_PER_MILLISECOND;\n\n // JulianDates are noon-based\n hour += 12;\n if (hour > 23) {\n hour -= 24;\n }\n\n //If we were on a leap second, add it back.\n if (isLeapSecond) {\n second += 1;\n }\n\n if (!defined(result)) {\n return new GregorianDate(\n year,\n month,\n day,\n hour,\n minute,\n second,\n millisecond,\n isLeapSecond,\n );\n }\n\n result.year = year;\n result.month = month;\n result.day = day;\n result.hour = hour;\n result.minute = minute;\n result.second = second;\n result.millisecond = millisecond;\n result.isLeapSecond = isLeapSecond;\n return result;\n};\n\n/**\n * Creates a JavaScript Date from the provided instance.\n * Since JavaScript dates are only accurate to the nearest millisecond and\n * cannot represent a leap second, consider using {@link JulianDate.toGregorianDate} instead.\n * If the provided JulianDate is during a leap second, the previous second is used.\n *\n * @param {JulianDate} julianDate The date to be converted.\n * @returns {Date} A new instance representing the provided date.\n */\nJulianDate.toDate = function (julianDate) {\n //>>includeStart('debug', pragmas.debug);\n if (!defined(julianDate)) {\n throw new DeveloperError(\"julianDate is required.\");\n }\n //>>includeEnd('debug');\n\n const gDate = JulianDate.toGregorianDate(julianDate, gregorianDateScratch);\n let second = gDate.second;\n if (gDate.isLeapSecond) {\n second -= 1;\n }\n return new Date(\n Date.UTC(\n gDate.year,\n gDate.month - 1,\n gDate.day,\n gDate.hour,\n gDate.minute,\n second,\n gDate.millisecond,\n ),\n );\n};\n\n/**\n * Creates an ISO8601 representation of the provided date.\n *\n * @param {JulianDate} julianDate The date to be converted.\n * @param {number} [precision] The number of fractional digits used to represent the seconds component. By default, the most precise representation is used.\n * @returns {string} The ISO8601 representation of the provided date.\n */\nJulianDate.toIso8601 = function (julianDate, precision) {\n //>>includeStart('debug', pragmas.debug);\n if (!defined(julianDate)) {\n throw new DeveloperError(\"julianDate is required.\");\n }\n //>>includeEnd('debug');\n\n const gDate = JulianDate.toGregorianDate(julianDate, gregorianDateScratch);\n let year = gDate.year;\n let month = gDate.month;\n let day = gDate.day;\n let hour = gDate.hour;\n const minute = gDate.minute;\n const second = gDate.second;\n const millisecond = gDate.millisecond;\n\n // special case - Iso8601.MAXIMUM_VALUE produces a string which we can't parse unless we adjust.\n // 10000-01-01T00:00:00 is the same instant as 9999-12-31T24:00:00\n if (\n year === 10000 &&\n month === 1 &&\n day === 1 &&\n hour === 0 &&\n minute === 0 &&\n second === 0 &&\n millisecond === 0\n ) {\n year = 9999;\n month = 12;\n day = 31;\n hour = 24;\n }\n\n let millisecondStr;\n\n if (!defined(precision) && millisecond !== 0) {\n //Forces milliseconds into a number with at least 3 digits to whatever the default toString() precision is.\n millisecondStr = (millisecond * 0.01).toString().replace(\".\", \"\");\n return `${year.toString().padStart(4, \"0\")}-${month\n .toString()\n .padStart(2, \"0\")}-${day.toString().padStart(2, \"0\")}T${hour\n .toString()\n .padStart(2, \"0\")}:${minute.toString().padStart(2, \"0\")}:${second\n .toString()\n .padStart(2, \"0\")}.${millisecondStr}Z`;\n }\n\n //Precision is either 0 or milliseconds is 0 with undefined precision, in either case, leave off milliseconds entirely\n if (!defined(precision) || precision === 0) {\n return `${year.toString().padStart(4, \"0\")}-${month\n .toString()\n .padStart(2, \"0\")}-${day.toString().padStart(2, \"0\")}T${hour\n .toString()\n .padStart(2, \"0\")}:${minute\n .toString()\n .padStart(2, \"0\")}:${second.toString().padStart(2, \"0\")}Z`;\n }\n\n //Forces milliseconds into a number with at least 3 digits to whatever the specified precision is.\n millisecondStr = (millisecond * 0.01)\n .toFixed(precision)\n .replace(\".\", \"\")\n .slice(0, precision);\n return `${year.toString().padStart(4, \"0\")}-${month\n .toString()\n .padStart(2, \"0\")}-${day.toString().padStart(2, \"0\")}T${hour\n .toString()\n .padStart(2, \"0\")}:${minute.toString().padStart(2, \"0\")}:${second\n .toString()\n .padStart(2, \"0\")}.${millisecondStr}Z`;\n};\n\n/**\n * Duplicates a JulianDate instance.\n *\n * @param {JulianDate} julianDate The date to duplicate.\n * @param {JulianDate} [result] An existing instance to use for the result.\n * @returns {JulianDate} The modified result parameter or a new instance if none was provided. Returns undefined if julianDate is undefined.\n */\nJulianDate.clone = function (julianDate, result) {\n if (!defined(julianDate)) {\n return undefined;\n }\n if (!defined(result)) {\n return new JulianDate(\n julianDate.dayNumber,\n julianDate.secondsOfDay,\n TimeStandard.TAI,\n );\n }\n result.dayNumber = julianDate.dayNumber;\n result.secondsOfDay = julianDate.secondsOfDay;\n return result;\n};\n\n/**\n * Compares two instances.\n *\n * @param {JulianDate} left The first instance.\n * @param {JulianDate} right The second instance.\n * @returns {number} 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.\n */\nJulianDate.compare = function (left, right) {\n //>>includeStart('debug', pragmas.debug);\n if (!defined(left)) {\n throw new DeveloperError(\"left is required.\");\n }\n if (!defined(right)) {\n throw new DeveloperError(\"right is required.\");\n }\n //>>includeEnd('debug');\n\n const julianDayNumberDifference = left.dayNumber - right.dayNumber;\n if (julianDayNumberDifference !== 0) {\n return julianDayNumberDifference;\n }\n return left.secondsOfDay - right.secondsOfDay;\n};\n\n/**\n * Compares two instances and returns true
if they are equal, false
otherwise.\n *\n * @param {JulianDate} [left] The first instance.\n * @param {JulianDate} [right] The second instance.\n * @returns {boolean} true
if the dates are equal; otherwise, false
.\n */\nJulianDate.equals = function (left, right) {\n return (\n left === right ||\n (defined(left) &&\n defined(right) &&\n left.dayNumber === right.dayNumber &&\n left.secondsOfDay === right.secondsOfDay)\n );\n};\n\n/**\n * Compares two instances and returns true
if they are within epsilon
seconds of\n * each other. That is, in order for the dates to be considered equal (and for\n * this function to return true
), the absolute value of the difference between them, in\n * seconds, must be less than epsilon
.\n *\n * @param {JulianDate} [left] The first instance.\n * @param {JulianDate} [right] The second instance.\n * @param {number} [epsilon=0] The maximum number of seconds that should separate the two instances.\n * @returns {boolean} true
if the two dates are within epsilon
seconds of each other; otherwise false
.\n */\nJulianDate.equalsEpsilon = function (left, right, epsilon) {\n epsilon = defaultValue(epsilon, 0);\n\n return (\n left === right ||\n (defined(left) &&\n defined(right) &&\n Math.abs(JulianDate.secondsDifference(left, right)) <= epsilon)\n );\n};\n\n/**\n * Computes the total number of whole and fractional days represented by the provided instance.\n *\n * @param {JulianDate} julianDate The date.\n * @returns {number} The Julian date as single floating point number.\n */\nJulianDate.totalDays = function (julianDate) {\n //>>includeStart('debug', pragmas.debug);\n if (!defined(julianDate)) {\n throw new DeveloperError(\"julianDate is required.\");\n }\n //>>includeEnd('debug');\n return (\n julianDate.dayNumber +\n julianDate.secondsOfDay / TimeConstants.SECONDS_PER_DAY\n );\n};\n\n/**\n * Computes the difference in seconds between the provided instance.\n *\n * @param {JulianDate} left The first instance.\n * @param {JulianDate} right The second instance.\n * @returns {number} The difference, in seconds, when subtracting right
from left
.\n */\nJulianDate.secondsDifference = function (left, right) {\n //>>includeStart('debug', pragmas.debug);\n if (!defined(left)) {\n throw new DeveloperError(\"left is required.\");\n }\n if (!defined(right)) {\n throw new DeveloperError(\"right is required.\");\n }\n //>>includeEnd('debug');\n\n const dayDifference =\n (left.dayNumber - right.dayNumber) * TimeConstants.SECONDS_PER_DAY;\n return dayDifference + (left.secondsOfDay - right.secondsOfDay);\n};\n\n/**\n * Computes the difference in days between the provided instance.\n *\n * @param {JulianDate} left The first instance.\n * @param {JulianDate} right The second instance.\n * @returns {number} The difference, in days, when subtracting right
from left
.\n */\nJulianDate.daysDifference = function (left, right) {\n //>>includeStart('debug', pragmas.debug);\n if (!defined(left)) {\n throw new DeveloperError(\"left is required.\");\n }\n if (!defined(right)) {\n throw new DeveloperError(\"right is required.\");\n }\n //>>includeEnd('debug');\n\n const dayDifference = left.dayNumber - right.dayNumber;\n const secondDifference =\n (left.secondsOfDay - right.secondsOfDay) / TimeConstants.SECONDS_PER_DAY;\n return dayDifference + secondDifference;\n};\n\n/**\n * Computes the number of seconds the provided instance is ahead of UTC.\n *\n * @param {JulianDate} julianDate The date.\n * @returns {number} The number of seconds the provided instance is ahead of UTC\n */\nJulianDate.computeTaiMinusUtc = function (julianDate) {\n binarySearchScratchLeapSecond.julianDate = julianDate;\n const leapSeconds = JulianDate.leapSeconds;\n let index = binarySearch(\n leapSeconds,\n binarySearchScratchLeapSecond,\n compareLeapSecondDates,\n );\n if (index < 0) {\n index = ~index;\n --index;\n if (index < 0) {\n index = 0;\n }\n }\n return leapSeconds[index].offset;\n};\n\n/**\n * Adds the provided number of seconds to the provided date instance.\n *\n * @param {JulianDate} julianDate The date.\n * @param {number} seconds The number of seconds to add or subtract.\n * @param {JulianDate} result An existing instance to use for the result.\n * @returns {JulianDate} The modified result parameter.\n */\nJulianDate.addSeconds = function (julianDate, seconds, result) {\n //>>includeStart('debug', pragmas.debug);\n if (!defined(julianDate)) {\n throw new DeveloperError(\"julianDate is required.\");\n }\n if (!defined(seconds)) {\n throw new DeveloperError(\"seconds is required.\");\n }\n if (!defined(result)) {\n throw new DeveloperError(\"result is required.\");\n }\n //>>includeEnd('debug');\n\n return setComponents(\n julianDate.dayNumber,\n julianDate.secondsOfDay + seconds,\n result,\n );\n};\n\n/**\n * Adds the provided number of minutes to the provided date instance.\n *\n * @param {JulianDate} julianDate The date.\n * @param {number} minutes The number of minutes to add or subtract.\n * @param {JulianDate} result An existing instance to use for the result.\n * @returns {JulianDate} The modified result parameter.\n */\nJulianDate.addMinutes = function (julianDate, minutes, result) {\n //>>includeStart('debug', pragmas.debug);\n if (!defined(julianDate)) {\n throw new DeveloperError(\"julianDate is required.\");\n }\n if (!defined(minutes)) {\n throw new DeveloperError(\"minutes is required.\");\n }\n if (!defined(result)) {\n throw new DeveloperError(\"result is required.\");\n }\n //>>includeEnd('debug');\n\n const newSecondsOfDay =\n julianDate.secondsOfDay + minutes * TimeConstants.SECONDS_PER_MINUTE;\n return setComponents(julianDate.dayNumber, newSecondsOfDay, result);\n};\n\n/**\n * Adds the provided number of hours to the provided date instance.\n *\n * @param {JulianDate} julianDate The date.\n * @param {number} hours The number of hours to add or subtract.\n * @param {JulianDate} result An existing instance to use for the result.\n * @returns {JulianDate} The modified result parameter.\n */\nJulianDate.addHours = function (julianDate, hours, result) {\n //>>includeStart('debug', pragmas.debug);\n if (!defined(julianDate)) {\n throw new DeveloperError(\"julianDate is required.\");\n }\n if (!defined(hours)) {\n throw new DeveloperError(\"hours is required.\");\n }\n if (!defined(result)) {\n throw new DeveloperError(\"result is required.\");\n }\n //>>includeEnd('debug');\n\n const newSecondsOfDay =\n julianDate.secondsOfDay + hours * TimeConstants.SECONDS_PER_HOUR;\n return setComponents(julianDate.dayNumber, newSecondsOfDay, result);\n};\n\n/**\n * Adds the provided number of days to the provided date instance.\n *\n * @param {JulianDate} julianDate The date.\n * @param {number} days The number of days to add or subtract.\n * @param {JulianDate} result An existing instance to use for the result.\n * @returns {JulianDate} The modified result parameter.\n */\nJulianDate.addDays = function (julianDate, days, result) {\n //>>includeStart('debug', pragmas.debug);\n if (!defined(julianDate)) {\n throw new DeveloperError(\"julianDate is required.\");\n }\n if (!defined(days)) {\n throw new DeveloperError(\"days is required.\");\n }\n if (!defined(result)) {\n throw new DeveloperError(\"result is required.\");\n }\n //>>includeEnd('debug');\n\n const newJulianDayNumber = julianDate.dayNumber + days;\n return setComponents(newJulianDayNumber, julianDate.secondsOfDay, result);\n};\n\n/**\n * Compares the provided instances and returns true
if left
is earlier than right
, false
otherwise.\n *\n * @param {JulianDate} left The first instance.\n * @param {JulianDate} right The second instance.\n * @returns {boolean} true
if left
is earlier than right
, false
otherwise.\n */\nJulianDate.lessThan = function (left, right) {\n return JulianDate.compare(left, right) < 0;\n};\n\n/**\n * Compares the provided instances and returns true
if left
is earlier than or equal to right
, false
otherwise.\n *\n * @param {JulianDate} left The first instance.\n * @param {JulianDate} right The second instance.\n * @returns {boolean} true
if left
is earlier than or equal to right
, false
otherwise.\n */\nJulianDate.lessThanOrEquals = function (left, right) {\n return JulianDate.compare(left, right) <= 0;\n};\n\n/**\n * Compares the provided instances and returns true
if left
is later than right
, false
otherwise.\n *\n * @param {JulianDate} left The first instance.\n * @param {JulianDate} right The second instance.\n * @returns {boolean} true
if left
is later than right
, false
otherwise.\n */\nJulianDate.greaterThan = function (left, right) {\n return JulianDate.compare(left, right) > 0;\n};\n\n/**\n * Compares the provided instances and returns true
if left
is later than or equal to right
, false
otherwise.\n *\n * @param {JulianDate} left The first instance.\n * @param {JulianDate} right The second instance.\n * @returns {boolean} true
if left
is later than or equal to right
, false
otherwise.\n */\nJulianDate.greaterThanOrEquals = function (left, right) {\n return JulianDate.compare(left, right) >= 0;\n};\n\n/**\n * Duplicates this instance.\n *\n * @param {JulianDate} [result] An existing instance to use for the result.\n * @returns {JulianDate} The modified result parameter or a new instance if none was provided.\n */\nJulianDate.prototype.clone = function (result) {\n return JulianDate.clone(this, result);\n};\n\n/**\n * Compares this and the provided instance and returns true
if they are equal, false
otherwise.\n *\n * @param {JulianDate} [right] The second instance.\n * @returns {boolean} true
if the dates are equal; otherwise, false
.\n */\nJulianDate.prototype.equals = function (right) {\n return JulianDate.equals(this, right);\n};\n\n/**\n * Compares this and the provided instance and returns true
if they are within epsilon
seconds of\n * each other. That is, in order for the dates to be considered equal (and for\n * this function to return true
), the absolute value of the difference between them, in\n * seconds, must be less than epsilon
.\n *\n * @param {JulianDate} [right] The second instance.\n * @param {number} [epsilon=0] The maximum number of seconds that should separate the two instances.\n * @returns {boolean} true
if the two dates are within epsilon
seconds of each other; otherwise false
.\n */\nJulianDate.prototype.equalsEpsilon = function (right, epsilon) {\n return JulianDate.equalsEpsilon(this, right, epsilon);\n};\n\n/**\n * Creates a string representing this date in ISO8601 format.\n *\n * @returns {string} A string representing this date in ISO8601 format.\n */\nJulianDate.prototype.toString = function () {\n return JulianDate.toIso8601(this);\n};\n\n/**\n * Gets or sets the list of leap seconds used throughout Cesium.\n * @memberof JulianDate\n * @type {LeapSecond[]}\n */\nJulianDate.leapSeconds = [\n new LeapSecond(new JulianDate(2441317, 43210.0, TimeStandard.TAI), 10), // January 1, 1972 00:00:00 UTC\n new LeapSecond(new JulianDate(2441499, 43211.0, TimeStandard.TAI), 11), // July 1, 1972 00:00:00 UTC\n new LeapSecond(new JulianDate(2441683, 43212.0, TimeStandard.TAI), 12), // January 1, 1973 00:00:00 UTC\n new LeapSecond(new JulianDate(2442048, 43213.0, TimeStandard.TAI), 13), // January 1, 1974 00:00:00 UTC\n new LeapSecond(new JulianDate(2442413, 43214.0, TimeStandard.TAI), 14), // January 1, 1975 00:00:00 UTC\n new LeapSecond(new JulianDate(2442778, 43215.0, TimeStandard.TAI), 15), // January 1, 1976 00:00:00 UTC\n new LeapSecond(new JulianDate(2443144, 43216.0, TimeStandard.TAI), 16), // January 1, 1977 00:00:00 UTC\n new LeapSecond(new JulianDate(2443509, 43217.0, TimeStandard.TAI), 17), // January 1, 1978 00:00:00 UTC\n new LeapSecond(new JulianDate(2443874, 43218.0, TimeStandard.TAI), 18), // January 1, 1979 00:00:00 UTC\n new LeapSecond(new JulianDate(2444239, 43219.0, TimeStandard.TAI), 19), // January 1, 1980 00:00:00 UTC\n new LeapSecond(new JulianDate(2444786, 43220.0, TimeStandard.TAI), 20), // July 1, 1981 00:00:00 UTC\n new LeapSecond(new JulianDate(2445151, 43221.0, TimeStandard.TAI), 21), // July 1, 1982 00:00:00 UTC\n new LeapSecond(new JulianDate(2445516, 43222.0, TimeStandard.TAI), 22), // July 1, 1983 00:00:00 UTC\n new LeapSecond(new JulianDate(2446247, 43223.0, TimeStandard.TAI), 23), // July 1, 1985 00:00:00 UTC\n new LeapSecond(new JulianDate(2447161, 43224.0, TimeStandard.TAI), 24), // January 1, 1988 00:00:00 UTC\n new LeapSecond(new JulianDate(2447892, 43225.0, TimeStandard.TAI), 25), // January 1, 1990 00:00:00 UTC\n new LeapSecond(new JulianDate(2448257, 43226.0, TimeStandard.TAI), 26), // January 1, 1991 00:00:00 UTC\n new LeapSecond(new JulianDate(2448804, 43227.0, TimeStandard.TAI), 27), // July 1, 1992 00:00:00 UTC\n new LeapSecond(new JulianDate(2449169, 43228.0, TimeStandard.TAI), 28), // July 1, 1993 00:00:00 UTC\n new LeapSecond(new JulianDate(2449534, 43229.0, TimeStandard.TAI), 29), // July 1, 1994 00:00:00 UTC\n new LeapSecond(new JulianDate(2450083, 43230.0, TimeStandard.TAI), 30), // January 1, 1996 00:00:00 UTC\n new LeapSecond(new JulianDate(2450630, 43231.0, TimeStandard.TAI), 31), // July 1, 1997 00:00:00 UTC\n new LeapSecond(new JulianDate(2451179, 43232.0, TimeStandard.TAI), 32), // January 1, 1999 00:00:00 UTC\n new LeapSecond(new JulianDate(2453736, 43233.0, TimeStandard.TAI), 33), // January 1, 2006 00:00:00 UTC\n new LeapSecond(new JulianDate(2454832, 43234.0, TimeStandard.TAI), 34), // January 1, 2009 00:00:00 UTC\n new LeapSecond(new JulianDate(2456109, 43235.0, TimeStandard.TAI), 35), // July 1, 2012 00:00:00 UTC\n new LeapSecond(new JulianDate(2457204, 43236.0, TimeStandard.TAI), 36), // July 1, 2015 00:00:00 UTC\n new LeapSecond(new JulianDate(2457754, 43237.0, TimeStandard.TAI), 37), // January 1, 2017 00:00:00 UTC\n];\nexport default JulianDate;\n","import Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport isLeapYear from \"./isLeapYear.js\";\n\nconst daysInYear = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\n\n/**\n * Represents a Gregorian date in a more precise format than the JavaScript Date object.\n * In addition to submillisecond precision, this object can also represent leap seconds.\n * @alias GregorianDate\n * @constructor\n *\n * @param {number} [year] The year as a whole number.\n * @param {number} [month] The month as a whole number with range [1, 12].\n * @param {number} [day] The day of the month as a whole number starting at 1.\n * @param {number} [hour] The hour as a whole number with range [0, 23].\n * @param {number} [minute] The minute of the hour as a whole number with range [0, 59].\n * @param {number} [second] The second of the minute as a whole number with range [0, 60], with 60 representing a leap second.\n * @param {number} [millisecond] The millisecond of the second as a floating point number with range [0.0, 1000.0).\n * @param {boolean} [isLeapSecond] Whether this time is during a leap second.\n *\n * @see JulianDate#toGregorianDate\n */\nfunction GregorianDate(\n year,\n month,\n day,\n hour,\n minute,\n second,\n millisecond,\n isLeapSecond,\n) {\n const minimumYear = 1;\n const minimumMonth = 1;\n const minimumDay = 1;\n const minimumHour = 0;\n const minimumMinute = 0;\n const minimumSecond = 0;\n const minimumMillisecond = 0;\n\n year = defaultValue(year, minimumYear);\n month = defaultValue(month, minimumMonth);\n day = defaultValue(day, minimumDay);\n hour = defaultValue(hour, minimumHour);\n minute = defaultValue(minute, minimumMinute);\n second = defaultValue(second, minimumSecond);\n millisecond = defaultValue(millisecond, minimumMillisecond);\n isLeapSecond = defaultValue(isLeapSecond, false);\n //>>includeStart('debug', pragmas.debug);\n validateRange();\n validateDate();\n //>>includeEnd('debug');\n\n /**\n * Gets or sets the year as a whole number.\n * @type {number}\n */\n this.year = year;\n /**\n * Gets or sets the month as a whole number with range [1, 12].\n * @type {number}\n */\n this.month = month;\n /**\n * Gets or sets the day of the month as a whole number starting at 1.\n * @type {number}\n */\n this.day = day;\n /**\n * Gets or sets the hour as a whole number with range [0, 23].\n * @type {number}\n */\n this.hour = hour;\n /**\n * Gets or sets the minute of the hour as a whole number with range [0, 59].\n * @type {number}\n */\n this.minute = minute;\n /**\n * Gets or sets the second of the minute as a whole number with range [0, 60], with 60 representing a leap second.\n * @type {number}\n */\n this.second = second;\n /**\n * Gets or sets the millisecond of the second as a floating point number with range [0.0, 1000.0).\n * @type {number}\n */\n this.millisecond = millisecond;\n /**\n * Gets or sets whether this time is during a leap second.\n * @type {boolean}\n */\n this.isLeapSecond = isLeapSecond;\n\n function validateRange() {\n const maximumYear = 9999;\n const maximumMonth = 12;\n const maximumDay = 31;\n const maximumHour = 23;\n const maximumMinute = 59;\n const maximumSecond = 59;\n const excludedMaximumMilisecond = 1000;\n\n Check.typeOf.number.greaterThanOrEquals(\"Year\", year, minimumYear);\n Check.typeOf.number.lessThanOrEquals(\"Year\", year, maximumYear);\n\n Check.typeOf.number.greaterThanOrEquals(\"Month\", month, minimumMonth);\n Check.typeOf.number.lessThanOrEquals(\"Month\", month, maximumMonth);\n\n Check.typeOf.number.greaterThanOrEquals(\"Day\", day, minimumDay);\n Check.typeOf.number.lessThanOrEquals(\"Day\", day, maximumDay);\n\n Check.typeOf.number.greaterThanOrEquals(\"Hour\", hour, minimumHour);\n Check.typeOf.number.lessThanOrEquals(\"Hour\", hour, maximumHour);\n\n Check.typeOf.number.greaterThanOrEquals(\"Minute\", minute, minimumMinute);\n Check.typeOf.number.lessThanOrEquals(\"Minute\", minute, maximumMinute);\n\n Check.typeOf.bool(\"IsLeapSecond\", isLeapSecond);\n\n Check.typeOf.number.greaterThanOrEquals(\"Second\", second, minimumSecond);\n Check.typeOf.number.lessThanOrEquals(\n \"Second\",\n second,\n isLeapSecond ? maximumSecond + 1 : maximumSecond,\n );\n\n Check.typeOf.number.greaterThanOrEquals(\n \"Millisecond\",\n millisecond,\n minimumMillisecond,\n );\n Check.typeOf.number.lessThan(\n \"Millisecond\",\n millisecond,\n excludedMaximumMilisecond,\n );\n }\n\n // Javascript date object supports only dates greater than 1901. Thus validating with custom logic\n function validateDate() {\n const daysInMonth =\n month === 2 && isLeapYear(year)\n ? daysInYear[month - 1] + 1\n : daysInYear[month - 1];\n\n if (day > daysInMonth) {\n throw new DeveloperError(\"Month and Day represents invalid date\");\n }\n }\n}\nexport default GregorianDate;\n","import DeveloperError from \"./DeveloperError.js\";\n\n/**\n * Determines if a given date is a leap year.\n *\n * @function isLeapYear\n *\n * @param {number} year The year to be tested.\n * @returns {boolean} True if year
is a leap year.\n *\n * @example\n * const leapYear = Cesium.isLeapYear(2000); // true\n */\nfunction isLeapYear(year) {\n //>>includeStart('debug', pragmas.debug);\n if (year === null || isNaN(year)) {\n throw new DeveloperError(\"year is required and must be a number.\");\n }\n //>>includeEnd('debug');\n\n return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;\n}\nexport default isLeapYear;\n","/**\n * Describes a single leap second, which is constructed from a {@link JulianDate} and a\n * numerical offset representing the number of seconds TAI is ahead of the UTC time standard.\n * @alias LeapSecond\n * @constructor\n *\n * @param {JulianDate} [date] A Julian date representing the time of the leap second.\n * @param {number} [offset] The cumulative number of seconds that TAI is ahead of UTC at the provided date.\n */\nfunction LeapSecond(date, offset) {\n /**\n * Gets or sets the date at which this leap second occurs.\n * @type {JulianDate}\n */\n this.julianDate = date;\n\n /**\n * Gets or sets the cumulative number of seconds between the UTC and TAI time standards at the time\n * of this leap second.\n * @type {number}\n */\n this.offset = offset;\n}\nexport default LeapSecond;\n","/**\n * Constants for time conversions like those done by {@link JulianDate}.\n *\n * @namespace TimeConstants\n *\n * @see JulianDate\n *\n * @private\n */\nconst TimeConstants = {\n /**\n * The number of seconds in one millisecond: 0.001
\n * @type {number}\n * @constant\n */\n SECONDS_PER_MILLISECOND: 0.001,\n\n /**\n * The number of seconds in one minute: 60
.\n * @type {number}\n * @constant\n */\n SECONDS_PER_MINUTE: 60.0,\n\n /**\n * The number of minutes in one hour: 60
.\n * @type {number}\n * @constant\n */\n MINUTES_PER_HOUR: 60.0,\n\n /**\n * The number of hours in one day: 24
.\n * @type {number}\n * @constant\n */\n HOURS_PER_DAY: 24.0,\n\n /**\n * The number of seconds in one hour: 3600
.\n * @type {number}\n * @constant\n */\n SECONDS_PER_HOUR: 3600.0,\n\n /**\n * The number of minutes in one day: 1440
.\n * @type {number}\n * @constant\n */\n MINUTES_PER_DAY: 1440.0,\n\n /**\n * The number of seconds in one day, ignoring leap seconds: 86400
.\n * @type {number}\n * @constant\n */\n SECONDS_PER_DAY: 86400.0,\n\n /**\n * The number of days in one Julian century: 36525
.\n * @type {number}\n * @constant\n */\n DAYS_PER_JULIAN_CENTURY: 36525.0,\n\n /**\n * One trillionth of a second.\n * @type {number}\n * @constant\n */\n PICOSECOND: 0.000000001,\n\n /**\n * The number of days to subtract from a Julian date to determine the\n * modified Julian date, which gives the number of days since midnight\n * on November 17, 1858.\n * @type {number}\n * @constant\n */\n MODIFIED_JULIAN_DATE_DIFFERENCE: 2400000.5,\n};\nexport default Object.freeze(TimeConstants);\n","/**\n * Provides the type of time standards which JulianDate can take as input.\n *\n * @enum {number}\n *\n * @see JulianDate\n */\nconst TimeStandard = {\n /**\n * Represents the coordinated Universal Time (UTC) time standard.\n *\n * UTC is related to TAI according to the relationship\n * UTC = TAI - deltaT
where deltaT
is the number of leap\n * seconds which have been introduced as of the time in TAI.\n *\n * @type {number}\n * @constant\n */\n UTC: 0,\n\n /**\n * Represents the International Atomic Time (TAI) time standard.\n * TAI is the principal time standard to which the other time standards are related.\n *\n * @type {number}\n * @constant\n */\n TAI: 1,\n};\nexport default Object.freeze(TimeStandard);\n","import Uri from \"urijs\";\nimport appendForwardSlash from \"./appendForwardSlash.js\";\nimport Check from \"./Check.js\";\nimport clone from \"./clone.js\";\nimport combine from \"./combine.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defer from \"./defer.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport getAbsoluteUri from \"./getAbsoluteUri.js\";\nimport getBaseUri from \"./getBaseUri.js\";\nimport getExtensionFromUri from \"./getExtensionFromUri.js\";\nimport getImagePixels from \"./getImagePixels.js\";\nimport isBlobUri from \"./isBlobUri.js\";\nimport isCrossOriginUrl from \"./isCrossOriginUrl.js\";\nimport isDataUri from \"./isDataUri.js\";\nimport loadAndExecuteScript from \"./loadAndExecuteScript.js\";\nimport CesiumMath from \"./Math.js\";\nimport objectToQuery from \"./objectToQuery.js\";\nimport queryToObject from \"./queryToObject.js\";\nimport Request from \"./Request.js\";\nimport RequestErrorEvent from \"./RequestErrorEvent.js\";\nimport RequestScheduler from \"./RequestScheduler.js\";\nimport RequestState from \"./RequestState.js\";\nimport RuntimeError from \"./RuntimeError.js\";\nimport TrustedServers from \"./TrustedServers.js\";\n\nconst xhrBlobSupported = (function () {\n try {\n const xhr = new XMLHttpRequest();\n xhr.open(\"GET\", \"#\", true);\n xhr.responseType = \"blob\";\n return xhr.responseType === \"blob\";\n } catch (e) {\n return false;\n }\n})();\n\n/**\n * @typedef {object} Resource.ConstructorOptions\n *\n * Initialization options for the Resource constructor\n *\n * @property {string} url The url of the resource.\n * @property {object} [queryParameters] An object containing query parameters that will be sent when retrieving the resource.\n * @property {object} [templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\n * @property {object} [headers={}] Additional HTTP headers that will be sent.\n * @property {Proxy} [proxy] A proxy to be used when loading the resource.\n * @property {Resource.RetryCallback} [retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\n * @property {number} [retryAttempts=0] The number of times the retryCallback should be called before giving up.\n * @property {Request} [request] A Request object that will be used. Intended for internal use only.\n * @property {boolean} [parseUrl=true] If true, parse the url for query parameters; otherwise store the url without change\n */\n\n/**\n * 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.\n *\n * @alias Resource\n * @constructor\n *\n * @param {string|Resource.ConstructorOptions} options A url or an object describing initialization options\n *\n * @example\n * function refreshTokenRetryCallback(resource, error) {\n * if (error.statusCode === 403) {\n * // 403 status code means a new token should be generated\n * return getNewAccessToken()\n * .then(function(token) {\n * resource.queryParameters.access_token = token;\n * return true;\n * })\n * .catch(function() {\n * return false;\n * });\n * }\n *\n * return false;\n * }\n *\n * const resource = new Resource({\n * url: 'http://server.com/path/to/resource.json',\n * proxy: new DefaultProxy('/proxy/'),\n * headers: {\n * 'X-My-Header': 'valueOfHeader'\n * },\n * queryParameters: {\n * 'access_token': '123-435-456-000'\n * },\n * retryCallback: refreshTokenRetryCallback,\n * retryAttempts: 1\n * });\n */\nfunction Resource(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n if (typeof options === \"string\") {\n options = {\n url: options,\n };\n }\n\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.string(\"options.url\", options.url);\n //>>includeEnd('debug');\n\n this._url = undefined;\n this._templateValues = defaultClone(options.templateValues, {});\n this._queryParameters = defaultClone(options.queryParameters, {});\n\n /**\n * Additional HTTP headers that will be sent with the request.\n *\n * @type {object}\n */\n this.headers = defaultClone(options.headers, {});\n\n /**\n * A Request object that will be used. Intended for internal use only.\n *\n * @type {Request}\n */\n this.request = defaultValue(options.request, new Request());\n\n /**\n * A proxy to be used when loading the resource.\n *\n * @type {Proxy}\n */\n this.proxy = options.proxy;\n\n /**\n * 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.\n *\n * @type {Function}\n */\n this.retryCallback = options.retryCallback;\n\n /**\n * The number of times the retryCallback should be called before giving up.\n *\n * @type {number}\n */\n this.retryAttempts = defaultValue(options.retryAttempts, 0);\n this._retryCount = 0;\n\n const parseUrl = defaultValue(options.parseUrl, true);\n if (parseUrl) {\n this.parseUrl(options.url, true, true);\n } else {\n this._url = options.url;\n }\n\n this._credits = options.credits;\n}\n\n/**\n * Clones a value if it is defined, otherwise returns the default value\n *\n * @param {object} [value] The value to clone.\n * @param {object} [defaultValue] The default value.\n *\n * @returns {object} A clone of value or the defaultValue.\n *\n * @private\n */\nfunction defaultClone(value, defaultValue) {\n return defined(value) ? clone(value) : defaultValue;\n}\n\n/**\n * A helper function to create a resource depending on whether we have a String or a Resource\n *\n * @param {Resource|string} resource A Resource or a String to use when creating a new Resource.\n *\n * @returns {Resource} If resource is a String, a Resource constructed with the url and options. Otherwise the resource parameter is returned.\n *\n * @private\n */\nResource.createIfNeeded = function (resource) {\n if (resource instanceof Resource) {\n // Keep existing request object. This function is used internally to duplicate a Resource, so that it can't\n // be modified outside of a class that holds it (eg. an imagery or terrain provider). Since the Request objects\n // are managed outside of the providers, by the tile loading code, we want to keep the request property the same so if it is changed\n // in the underlying tiling code the requests for this resource will use it.\n return resource.getDerivedResource({\n request: resource.request,\n });\n }\n\n if (typeof resource !== \"string\") {\n return resource;\n }\n\n return new Resource({\n url: resource,\n });\n};\n\nlet supportsImageBitmapOptionsPromise;\n/**\n * A helper function to check whether createImageBitmap supports passing ImageBitmapOptions.\n *\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n *\n * @example\n * // load a single URL asynchronously\n * resource.fetchArrayBuffer().then(function(arrayBuffer) {\n * // use the data\n * }).catch(function(error) {\n * // an error occurred\n * });\n *\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\n */\nResource.prototype.fetchArrayBuffer = function () {\n return this.fetch({\n responseType: \"arraybuffer\",\n });\n};\n\n/**\n * Creates a Resource and calls fetchArrayBuffer() on it.\n *\n * @param {string|object} options A url or an object with the following properties\n * @param {string} options.url The url of the resource.\n * @param {object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\n * @param {object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\n * @param {object} [options.headers={}] Additional HTTP headers that will be sent.\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\n * @param {number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n */\nResource.fetchArrayBuffer = function (options) {\n const resource = new Resource(options);\n return resource.fetchArrayBuffer();\n};\n\n/**\n * Asynchronously loads the given resource as a blob. Returns a promise that will resolve to\n * a Blob once loaded, or reject if the resource failed to load. The data is loaded\n * using XMLHttpRequest, which means that in order to make requests to another origin,\n * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.\n *\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n *\n * @example\n * // load a single URL asynchronously\n * resource.fetchBlob().then(function(blob) {\n * // use the data\n * }).catch(function(error) {\n * // an error occurred\n * });\n *\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\n */\nResource.prototype.fetchBlob = function () {\n return this.fetch({\n responseType: \"blob\",\n });\n};\n\n/**\n * Creates a Resource and calls fetchBlob() on it.\n *\n * @param {string|object} options A url or an object with the following properties\n * @param {string} options.url The url of the resource.\n * @param {object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\n * @param {object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\n * @param {object} [options.headers={}] Additional HTTP headers that will be sent.\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\n * @param {number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n */\nResource.fetchBlob = function (options) {\n const resource = new Resource(options);\n return resource.fetchBlob();\n};\n\n/**\n * Asynchronously loads the given image resource. Returns a promise that will resolve to\n * 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\n * {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement|Image} once loaded, or reject if the image failed to load.\n *\n * @param {object} [options] An object with the following properties.\n * @param {boolean} [options.preferBlob=false] If true, we will load the image via a blob.\n * @param {boolean} [options.preferImageBitmap=false] If true, image will be decoded during fetch and an ImageBitmap
is returned.\n * @param {boolean} [options.flipY=false] If true, image will be vertically flipped during decode. Only applies if the browser supports createImageBitmap
.\n * @param {boolean} [options.skipColorSpaceConversion=false] If true, any custom gamma or color profiles in the image will be ignored. Only applies if the browser supports createImageBitmap
.\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n *\n *\n * @example\n * // load a single image asynchronously\n * resource.fetchImage().then(function(image) {\n * // use the loaded image\n * }).catch(function(error) {\n * // an error occurred\n * });\n *\n * // load several images in parallel\n * Promise.all([resource1.fetchImage(), resource2.fetchImage()]).then(function(images) {\n * // images is an array containing all the loaded images\n * });\n *\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\n */\nResource.prototype.fetchImage = function (options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const preferImageBitmap = defaultValue(options.preferImageBitmap, false);\n const preferBlob = defaultValue(options.preferBlob, false);\n const flipY = defaultValue(options.flipY, false);\n const skipColorSpaceConversion = defaultValue(\n options.skipColorSpaceConversion,\n false,\n );\n\n checkAndResetRequest(this.request);\n // We try to load the image normally if\n // 1. Blobs aren't supported\n // 2. It's a data URI\n // 3. It's a blob URI\n // 4. It doesn't have request headers and we preferBlob is false\n if (\n !xhrBlobSupported ||\n this.isDataUri ||\n this.isBlobUri ||\n (!this.hasHeaders && !preferBlob)\n ) {\n return fetchImage({\n resource: this,\n flipY: flipY,\n skipColorSpaceConversion: skipColorSpaceConversion,\n preferImageBitmap: preferImageBitmap,\n });\n }\n\n const blobPromise = this.fetchBlob();\n if (!defined(blobPromise)) {\n return;\n }\n\n let supportsImageBitmap;\n let useImageBitmap;\n let generatedBlobResource;\n let generatedBlob;\n return Resource.supportsImageBitmapOptions()\n .then(function (result) {\n supportsImageBitmap = result;\n useImageBitmap = supportsImageBitmap && preferImageBitmap;\n return blobPromise;\n })\n .then(function (blob) {\n if (!defined(blob)) {\n return;\n }\n generatedBlob = blob;\n if (useImageBitmap) {\n return Resource.createImageBitmapFromBlob(blob, {\n flipY: flipY,\n premultiplyAlpha: false,\n skipColorSpaceConversion: skipColorSpaceConversion,\n });\n }\n const blobUrl = window.URL.createObjectURL(blob);\n generatedBlobResource = new Resource({\n url: blobUrl,\n });\n\n return fetchImage({\n resource: generatedBlobResource,\n flipY: flipY,\n skipColorSpaceConversion: skipColorSpaceConversion,\n preferImageBitmap: false,\n });\n })\n .then(function (image) {\n if (!defined(image)) {\n return;\n }\n\n // The blob object may be needed for use by a TileDiscardPolicy,\n // so attach it to the image.\n image.blob = generatedBlob;\n\n if (useImageBitmap) {\n return image;\n }\n\n window.URL.revokeObjectURL(generatedBlobResource.url);\n return image;\n })\n .catch(function (error) {\n if (defined(generatedBlobResource)) {\n window.URL.revokeObjectURL(generatedBlobResource.url);\n }\n\n // If the blob load succeeded but the image decode failed, attach the blob\n // to the error object for use by a TileDiscardPolicy.\n // In particular, BingMapsImageryProvider uses this to detect the\n // zero-length response that is returned when a tile is not available.\n error.blob = generatedBlob;\n\n return Promise.reject(error);\n });\n};\n\n/**\n * Fetches an image and returns a promise to it.\n *\n * @param {object} [options] An object with the following properties.\n * @param {Resource} [options.resource] Resource object that points to an image to fetch.\n * @param {boolean} [options.preferImageBitmap] If true, image will be decoded during fetch and an ImageBitmap
is returned.\n * @param {boolean} [options.flipY] If true, image will be vertically flipped during decode. Only applies if the browser supports createImageBitmap
.\n * @param {boolean} [options.skipColorSpaceConversion=false] If true, any custom gamma or color profiles in the image will be ignored. Only applies if the browser supports createImageBitmap
.\n * @private\n */\nfunction fetchImage(options) {\n const resource = options.resource;\n const flipY = options.flipY;\n const skipColorSpaceConversion = options.skipColorSpaceConversion;\n const preferImageBitmap = options.preferImageBitmap;\n\n const request = resource.request;\n request.url = resource.url;\n request.requestFunction = function () {\n let crossOrigin = false;\n\n // data URIs can't have crossorigin set.\n if (!resource.isDataUri && !resource.isBlobUri) {\n crossOrigin = resource.isCrossOriginUrl;\n }\n\n const deferred = defer();\n Resource._Implementations.createImage(\n request,\n crossOrigin,\n deferred,\n flipY,\n skipColorSpaceConversion,\n preferImageBitmap,\n );\n\n return deferred.promise;\n };\n\n const promise = RequestScheduler.request(request);\n if (!defined(promise)) {\n return;\n }\n\n return promise.catch(function (e) {\n // Don't retry cancelled or otherwise aborted requests\n if (request.state !== RequestState.FAILED) {\n return Promise.reject(e);\n }\n return resource.retryOnError(e).then(function (retry) {\n if (retry) {\n // Reset request so it can try again\n request.state = RequestState.UNISSUED;\n request.deferred = undefined;\n\n return fetchImage({\n resource: resource,\n flipY: flipY,\n skipColorSpaceConversion: skipColorSpaceConversion,\n preferImageBitmap: preferImageBitmap,\n });\n }\n return Promise.reject(e);\n });\n });\n}\n\n/**\n * Creates a Resource and calls fetchImage() on it.\n *\n * @param {string|object} options A url or an object with the following properties\n * @param {string} options.url The url of the resource.\n * @param {object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\n * @param {object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\n * @param {object} [options.headers={}] Additional HTTP headers that will be sent.\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\n * @param {boolean} [options.flipY=false] Whether to vertically flip the image during fetch and decode. Only applies when requesting an image and the browser supports createImageBitmap
.\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\n * @param {number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\n * @param {boolean} [options.preferBlob=false] If true, we will load the image via a blob.\n * @param {boolean} [options.preferImageBitmap=false] If true, image will be decoded during fetch and an ImageBitmap
is returned.\n * @param {boolean} [options.skipColorSpaceConversion=false] If true, any custom gamma or color profiles in the image will be ignored. Only applies when requesting an image and the browser supports createImageBitmap
.\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n */\nResource.fetchImage = function (options) {\n const resource = new Resource(options);\n return resource.fetchImage({\n flipY: options.flipY,\n skipColorSpaceConversion: options.skipColorSpaceConversion,\n preferBlob: options.preferBlob,\n preferImageBitmap: options.preferImageBitmap,\n });\n};\n\n/**\n * Asynchronously loads the given resource as text. Returns a promise that will resolve to\n * a String once loaded, or reject if the resource failed to load. The data is loaded\n * using XMLHttpRequest, which means that in order to make requests to another origin,\n * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.\n *\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n *\n * @example\n * // load text from a URL, setting a custom header\n * const resource = new Resource({\n * url: 'http://someUrl.com/someJson.txt',\n * headers: {\n * 'X-Custom-Header' : 'some value'\n * }\n * });\n * resource.fetchText().then(function(text) {\n * // Do something with the text\n * }).catch(function(error) {\n * // an error occurred\n * });\n *\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest|XMLHttpRequest}\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\n */\nResource.prototype.fetchText = function () {\n return this.fetch({\n responseType: \"text\",\n });\n};\n\n/**\n * Creates a Resource and calls fetchText() on it.\n *\n * @param {string|object} options A url or an object with the following properties\n * @param {string} options.url The url of the resource.\n * @param {object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\n * @param {object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\n * @param {object} [options.headers={}] Additional HTTP headers that will be sent.\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\n * @param {number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n */\nResource.fetchText = function (options) {\n const resource = new Resource(options);\n return resource.fetchText();\n};\n\n// note: */* below is */* but that ends the comment block early\n/**\n * Asynchronously loads the given resource as JSON. Returns a promise that will resolve to\n * a JSON object once loaded, or reject if the resource failed to load. The data is loaded\n * using XMLHttpRequest, which means that in order to make requests to another origin,\n * the server must have Cross-Origin Resource Sharing (CORS) headers enabled. This function\n * adds 'Accept: application/json,*/*;q=0.01' to the request headers, if not\n * already specified.\n *\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n *\n *\n * @example\n * resource.fetchJson().then(function(jsonData) {\n * // Do something with the JSON object\n * }).catch(function(error) {\n * // an error occurred\n * });\n *\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\n */\nResource.prototype.fetchJson = function () {\n const promise = this.fetch({\n responseType: \"text\",\n headers: {\n Accept: \"application/json,*/*;q=0.01\",\n },\n });\n\n if (!defined(promise)) {\n return undefined;\n }\n\n return promise.then(function (value) {\n if (!defined(value)) {\n return;\n }\n return JSON.parse(value);\n });\n};\n\n/**\n * Creates a Resource and calls fetchJson() on it.\n *\n * @param {string|object} options A url or an object with the following properties\n * @param {string} options.url The url of the resource.\n * @param {object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\n * @param {object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\n * @param {object} [options.headers={}] Additional HTTP headers that will be sent.\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\n * @param {number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n */\nResource.fetchJson = function (options) {\n const resource = new Resource(options);\n return resource.fetchJson();\n};\n\n/**\n * Asynchronously loads the given resource as XML. Returns a promise that will resolve to\n * an XML Document once loaded, or reject if the resource failed to load. The data is loaded\n * using XMLHttpRequest, which means that in order to make requests to another origin,\n * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.\n *\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n *\n *\n * @example\n * // load XML from a URL, setting a custom header\n * Cesium.loadXML('http://someUrl.com/someXML.xml', {\n * 'X-Custom-Header' : 'some value'\n * }).then(function(document) {\n * // Do something with the document\n * }).catch(function(error) {\n * // an error occurred\n * });\n *\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest|XMLHttpRequest}\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\n */\nResource.prototype.fetchXML = function () {\n return this.fetch({\n responseType: \"document\",\n overrideMimeType: \"text/xml\",\n });\n};\n\n/**\n * Creates a Resource and calls fetchXML() on it.\n *\n * @param {string|object} options A url or an object with the following properties\n * @param {string} options.url The url of the resource.\n * @param {object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\n * @param {object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\n * @param {object} [options.headers={}] Additional HTTP headers that will be sent.\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\n * @param {number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n */\nResource.fetchXML = function (options) {\n const resource = new Resource(options);\n return resource.fetchXML();\n};\n\n/**\n * Requests a resource using JSONP.\n *\n * @param {string} [callbackParameterName='callback'] The callback parameter name that the server expects.\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n *\n *\n * @example\n * // load a data asynchronously\n * resource.fetchJsonp().then(function(data) {\n * // use the loaded data\n * }).catch(function(error) {\n * // an error occurred\n * });\n *\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\n */\nResource.prototype.fetchJsonp = function (callbackParameterName) {\n callbackParameterName = defaultValue(callbackParameterName, \"callback\");\n\n checkAndResetRequest(this.request);\n\n //generate a unique function name\n let functionName;\n do {\n functionName = `loadJsonp${CesiumMath.nextRandomNumber()\n .toString()\n .substring(2, 8)}`;\n } while (defined(window[functionName]));\n\n return fetchJsonp(this, callbackParameterName, functionName);\n};\n\nfunction fetchJsonp(resource, callbackParameterName, functionName) {\n const callbackQuery = {};\n callbackQuery[callbackParameterName] = functionName;\n resource.setQueryParameters(callbackQuery);\n\n const request = resource.request;\n const url = resource.url;\n request.url = url;\n request.requestFunction = function () {\n const deferred = defer();\n\n //assign a function with that name in the global scope\n window[functionName] = function (data) {\n deferred.resolve(data);\n\n try {\n delete window[functionName];\n } catch (e) {\n window[functionName] = undefined;\n }\n };\n\n Resource._Implementations.loadAndExecuteScript(url, functionName, deferred);\n return deferred.promise;\n };\n\n const promise = RequestScheduler.request(request);\n if (!defined(promise)) {\n return;\n }\n\n return promise.catch(function (e) {\n if (request.state !== RequestState.FAILED) {\n return Promise.reject(e);\n }\n\n return resource.retryOnError(e).then(function (retry) {\n if (retry) {\n // Reset request so it can try again\n request.state = RequestState.UNISSUED;\n request.deferred = undefined;\n\n return fetchJsonp(resource, callbackParameterName, functionName);\n }\n\n return Promise.reject(e);\n });\n });\n}\n\n/**\n * Creates a Resource from a URL and calls fetchJsonp() on it.\n *\n * @param {string|object} options A url or an object with the following properties\n * @param {string} options.url The url of the resource.\n * @param {object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\n * @param {object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\n * @param {object} [options.headers={}] Additional HTTP headers that will be sent.\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\n * @param {number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\n * @param {string} [options.callbackParameterName='callback'] The callback parameter name that the server expects.\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n */\nResource.fetchJsonp = function (options) {\n const resource = new Resource(options);\n return resource.fetchJsonp(options.callbackParameterName);\n};\n\n/**\n * @private\n */\nResource.prototype._makeRequest = function (options) {\n const resource = this;\n checkAndResetRequest(resource.request);\n\n const request = resource.request;\n const url = resource.url;\n request.url = url;\n\n request.requestFunction = function () {\n const responseType = options.responseType;\n const headers = combine(options.headers, resource.headers);\n const overrideMimeType = options.overrideMimeType;\n const method = options.method;\n const data = options.data;\n const deferred = defer();\n const xhr = Resource._Implementations.loadWithXhr(\n url,\n responseType,\n method,\n data,\n headers,\n deferred,\n overrideMimeType,\n );\n if (defined(xhr) && defined(xhr.abort)) {\n request.cancelFunction = function () {\n xhr.abort();\n };\n }\n return deferred.promise;\n };\n\n const promise = RequestScheduler.request(request);\n if (!defined(promise)) {\n return;\n }\n\n return promise\n .then(function (data) {\n // explicitly set to undefined to ensure GC of request response data. See #8843\n request.cancelFunction = undefined;\n return data;\n })\n .catch(function (e) {\n request.cancelFunction = undefined;\n if (request.state !== RequestState.FAILED) {\n return Promise.reject(e);\n }\n\n return resource.retryOnError(e).then(function (retry) {\n if (retry) {\n // Reset request so it can try again\n request.state = RequestState.UNISSUED;\n request.deferred = undefined;\n\n return resource.fetch(options);\n }\n\n return Promise.reject(e);\n });\n });\n};\n\n/**\n * Checks to make sure the Resource isn't already being requested.\n *\n * @param {Request} request The request to check.\n *\n * @private\n */\nfunction checkAndResetRequest(request) {\n if (\n request.state === RequestState.ISSUED ||\n request.state === RequestState.ACTIVE\n ) {\n throw new RuntimeError(\"The Resource is already being fetched.\");\n }\n\n request.state = RequestState.UNISSUED;\n request.deferred = undefined;\n}\n\nconst dataUriRegex = /^data:(.*?)(;base64)?,(.*)$/;\n\nfunction decodeDataUriText(isBase64, data) {\n const result = decodeURIComponent(data);\n if (isBase64) {\n return atob(result);\n }\n return result;\n}\n\nfunction decodeDataUriArrayBuffer(isBase64, data) {\n const byteString = decodeDataUriText(isBase64, data);\n const buffer = new ArrayBuffer(byteString.length);\n const view = new Uint8Array(buffer);\n for (let i = 0; i < byteString.length; i++) {\n view[i] = byteString.charCodeAt(i);\n }\n return buffer;\n}\n\nfunction decodeDataUri(dataUriRegexResult, responseType) {\n responseType = defaultValue(responseType, \"\");\n const mimeType = dataUriRegexResult[1];\n const isBase64 = !!dataUriRegexResult[2];\n const data = dataUriRegexResult[3];\n let buffer;\n let parser;\n\n switch (responseType) {\n case \"\":\n case \"text\":\n return decodeDataUriText(isBase64, data);\n case \"arraybuffer\":\n return decodeDataUriArrayBuffer(isBase64, data);\n case \"blob\":\n buffer = decodeDataUriArrayBuffer(isBase64, data);\n return new Blob([buffer], {\n type: mimeType,\n });\n case \"document\":\n parser = new DOMParser();\n return parser.parseFromString(\n decodeDataUriText(isBase64, data),\n mimeType,\n );\n case \"json\":\n return JSON.parse(decodeDataUriText(isBase64, data));\n default:\n //>>includeStart('debug', pragmas.debug);\n throw new DeveloperError(`Unhandled responseType: ${responseType}`);\n //>>includeEnd('debug');\n }\n}\n\n/**\n * Asynchronously loads the given resource. Returns a promise that will resolve to\n * the result once loaded, or reject if the resource failed to load. The data is loaded\n * using XMLHttpRequest, which means that in order to make requests to another origin,\n * the server must have Cross-Origin Resource Sharing (CORS) headers enabled. It's recommended that you use\n * the more specific functions eg. fetchJson, fetchBlob, etc.\n *\n * @param {object} [options] Object with the following properties:\n * @param {string} [options.responseType] The type of response. This controls the type of item returned.\n * @param {object} [options.headers] Additional HTTP headers to send with the request, if any.\n * @param {string} [options.overrideMimeType] Overrides the MIME type returned by the server.\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n *\n *\n * @example\n * resource.fetch()\n * .then(function(body) {\n * // use the data\n * }).catch(function(error) {\n * // an error occurred\n * });\n *\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\n */\nResource.prototype.fetch = function (options) {\n options = defaultClone(options, {});\n options.method = \"GET\";\n\n return this._makeRequest(options);\n};\n\n/**\n * Creates a Resource from a URL and calls fetch() on it.\n *\n * @param {string|object} options A url or an object with the following properties\n * @param {string} options.url The url of the resource.\n * @param {object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\n * @param {object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\n * @param {object} [options.headers={}] Additional HTTP headers that will be sent.\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\n * @param {number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\n * @param {string} [options.responseType] The type of response. This controls the type of item returned.\n * @param {string} [options.overrideMimeType] Overrides the MIME type returned by the server.\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n */\nResource.fetch = function (options) {\n const resource = new Resource(options);\n return resource.fetch({\n // Make copy of just the needed fields because headers can be passed to both the constructor and to fetch\n responseType: options.responseType,\n overrideMimeType: options.overrideMimeType,\n });\n};\n\n/**\n * Asynchronously deletes the given resource. Returns a promise that will resolve to\n * the result once loaded, or reject if the resource failed to load. The data is loaded\n * using XMLHttpRequest, which means that in order to make requests to another origin,\n * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.\n *\n * @param {object} [options] Object with the following properties:\n * @param {string} [options.responseType] The type of response. This controls the type of item returned.\n * @param {object} [options.headers] Additional HTTP headers to send with the request, if any.\n * @param {string} [options.overrideMimeType] Overrides the MIME type returned by the server.\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n *\n *\n * @example\n * resource.delete()\n * .then(function(body) {\n * // use the data\n * }).catch(function(error) {\n * // an error occurred\n * });\n *\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\n */\nResource.prototype.delete = function (options) {\n options = defaultClone(options, {});\n options.method = \"DELETE\";\n\n return this._makeRequest(options);\n};\n\n/**\n * Creates a Resource from a URL and calls delete() on it.\n *\n * @param {string|object} options A url or an object with the following properties\n * @param {string} options.url The url of the resource.\n * @param {object} [options.data] Data that is posted with the resource.\n * @param {object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\n * @param {object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\n * @param {object} [options.headers={}] Additional HTTP headers that will be sent.\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\n * @param {number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\n * @param {string} [options.responseType] The type of response. This controls the type of item returned.\n * @param {string} [options.overrideMimeType] Overrides the MIME type returned by the server.\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n */\nResource.delete = function (options) {\n const resource = new Resource(options);\n return resource.delete({\n // Make copy of just the needed fields because headers can be passed to both the constructor and to fetch\n responseType: options.responseType,\n overrideMimeType: options.overrideMimeType,\n data: options.data,\n });\n};\n\n/**\n * Asynchronously gets headers the given resource. Returns a promise that will resolve to\n * the result once loaded, or reject if the resource failed to load. The data is loaded\n * using XMLHttpRequest, which means that in order to make requests to another origin,\n * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.\n *\n * @param {object} [options] Object with the following properties:\n * @param {string} [options.responseType] The type of response. This controls the type of item returned.\n * @param {object} [options.headers] Additional HTTP headers to send with the request, if any.\n * @param {string} [options.overrideMimeType] Overrides the MIME type returned by the server.\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n *\n *\n * @example\n * resource.head()\n * .then(function(headers) {\n * // use the data\n * }).catch(function(error) {\n * // an error occurred\n * });\n *\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\n */\nResource.prototype.head = function (options) {\n options = defaultClone(options, {});\n options.method = \"HEAD\";\n\n return this._makeRequest(options);\n};\n\n/**\n * Creates a Resource from a URL and calls head() on it.\n *\n * @param {string|object} options A url or an object with the following properties\n * @param {string} options.url The url of the resource.\n * @param {object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\n * @param {object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\n * @param {object} [options.headers={}] Additional HTTP headers that will be sent.\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\n * @param {number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\n * @param {string} [options.responseType] The type of response. This controls the type of item returned.\n * @param {string} [options.overrideMimeType] Overrides the MIME type returned by the server.\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n */\nResource.head = function (options) {\n const resource = new Resource(options);\n return resource.head({\n // Make copy of just the needed fields because headers can be passed to both the constructor and to fetch\n responseType: options.responseType,\n overrideMimeType: options.overrideMimeType,\n });\n};\n\n/**\n * Asynchronously gets options the given resource. Returns a promise that will resolve to\n * the result once loaded, or reject if the resource failed to load. The data is loaded\n * using XMLHttpRequest, which means that in order to make requests to another origin,\n * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.\n *\n * @param {object} [options] Object with the following properties:\n * @param {string} [options.responseType] The type of response. This controls the type of item returned.\n * @param {object} [options.headers] Additional HTTP headers to send with the request, if any.\n * @param {string} [options.overrideMimeType] Overrides the MIME type returned by the server.\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n *\n *\n * @example\n * resource.options()\n * .then(function(headers) {\n * // use the data\n * }).catch(function(error) {\n * // an error occurred\n * });\n *\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\n */\nResource.prototype.options = function (options) {\n options = defaultClone(options, {});\n options.method = \"OPTIONS\";\n\n return this._makeRequest(options);\n};\n\n/**\n * Creates a Resource from a URL and calls options() on it.\n *\n * @param {string|object} options A url or an object with the following properties\n * @param {string} options.url The url of the resource.\n * @param {object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\n * @param {object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\n * @param {object} [options.headers={}] Additional HTTP headers that will be sent.\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\n * @param {number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\n * @param {string} [options.responseType] The type of response. This controls the type of item returned.\n * @param {string} [options.overrideMimeType] Overrides the MIME type returned by the server.\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n */\nResource.options = function (options) {\n const resource = new Resource(options);\n return resource.options({\n // Make copy of just the needed fields because headers can be passed to both the constructor and to fetch\n responseType: options.responseType,\n overrideMimeType: options.overrideMimeType,\n });\n};\n\n/**\n * Asynchronously posts data to the given resource. Returns a promise that will resolve to\n * the result once loaded, or reject if the resource failed to load. The data is loaded\n * using XMLHttpRequest, which means that in order to make requests to another origin,\n * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.\n *\n * @param {object} data Data that is posted with the resource.\n * @param {object} [options] Object with the following properties:\n * @param {object} [options.data] Data that is posted with the resource.\n * @param {string} [options.responseType] The type of response. This controls the type of item returned.\n * @param {object} [options.headers] Additional HTTP headers to send with the request, if any.\n * @param {string} [options.overrideMimeType] Overrides the MIME type returned by the server.\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n *\n *\n * @example\n * resource.post(data)\n * .then(function(result) {\n * // use the result\n * }).catch(function(error) {\n * // an error occurred\n * });\n *\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\n */\nResource.prototype.post = function (data, options) {\n Check.defined(\"data\", data);\n\n options = defaultClone(options, {});\n options.method = \"POST\";\n options.data = data;\n\n return this._makeRequest(options);\n};\n\n/**\n * Creates a Resource from a URL and calls post() on it.\n *\n * @param {object} options A url or an object with the following properties\n * @param {string} options.url The url of the resource.\n * @param {object} options.data Data that is posted with the resource.\n * @param {object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\n * @param {object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\n * @param {object} [options.headers={}] Additional HTTP headers that will be sent.\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\n * @param {number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\n * @param {string} [options.responseType] The type of response. This controls the type of item returned.\n * @param {string} [options.overrideMimeType] Overrides the MIME type returned by the server.\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n */\nResource.post = function (options) {\n const resource = new Resource(options);\n return resource.post(options.data, {\n // Make copy of just the needed fields because headers can be passed to both the constructor and to post\n responseType: options.responseType,\n overrideMimeType: options.overrideMimeType,\n });\n};\n\n/**\n * Asynchronously puts data to the given resource. Returns a promise that will resolve to\n * the result once loaded, or reject if the resource failed to load. The data is loaded\n * using XMLHttpRequest, which means that in order to make requests to another origin,\n * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.\n *\n * @param {object} data Data that is posted with the resource.\n * @param {object} [options] Object with the following properties:\n * @param {string} [options.responseType] The type of response. This controls the type of item returned.\n * @param {object} [options.headers] Additional HTTP headers to send with the request, if any.\n * @param {string} [options.overrideMimeType] Overrides the MIME type returned by the server.\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n *\n *\n * @example\n * resource.put(data)\n * .then(function(result) {\n * // use the result\n * }).catch(function(error) {\n * // an error occurred\n * });\n *\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\n */\nResource.prototype.put = function (data, options) {\n Check.defined(\"data\", data);\n\n options = defaultClone(options, {});\n options.method = \"PUT\";\n options.data = data;\n\n return this._makeRequest(options);\n};\n\n/**\n * Creates a Resource from a URL and calls put() on it.\n *\n * @param {object} options A url or an object with the following properties\n * @param {string} options.url The url of the resource.\n * @param {object} options.data Data that is posted with the resource.\n * @param {object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\n * @param {object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\n * @param {object} [options.headers={}] Additional HTTP headers that will be sent.\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\n * @param {number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\n * @param {string} [options.responseType] The type of response. This controls the type of item returned.\n * @param {string} [options.overrideMimeType] Overrides the MIME type returned by the server.\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n */\nResource.put = function (options) {\n const resource = new Resource(options);\n return resource.put(options.data, {\n // Make copy of just the needed fields because headers can be passed to both the constructor and to post\n responseType: options.responseType,\n overrideMimeType: options.overrideMimeType,\n });\n};\n\n/**\n * Asynchronously patches data to the given resource. Returns a promise that will resolve to\n * the result once loaded, or reject if the resource failed to load. The data is loaded\n * using XMLHttpRequest, which means that in order to make requests to another origin,\n * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.\n *\n * @param {object} data Data that is posted with the resource.\n * @param {object} [options] Object with the following properties:\n * @param {string} [options.responseType] The type of response. This controls the type of item returned.\n * @param {object} [options.headers] Additional HTTP headers to send with the request, if any.\n * @param {string} [options.overrideMimeType] Overrides the MIME type returned by the server.\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n *\n *\n * @example\n * resource.patch(data)\n * .then(function(result) {\n * // use the result\n * }).catch(function(error) {\n * // an error occurred\n * });\n *\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\n */\nResource.prototype.patch = function (data, options) {\n Check.defined(\"data\", data);\n\n options = defaultClone(options, {});\n options.method = \"PATCH\";\n options.data = data;\n\n return this._makeRequest(options);\n};\n\n/**\n * Creates a Resource from a URL and calls patch() on it.\n *\n * @param {object} options A url or an object with the following properties\n * @param {string} options.url The url of the resource.\n * @param {object} options.data Data that is posted with the resource.\n * @param {object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\n * @param {object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\n * @param {object} [options.headers={}] Additional HTTP headers that will be sent.\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\n * @param {number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\n * @param {string} [options.responseType] The type of response. This controls the type of item returned.\n * @param {string} [options.overrideMimeType] Overrides the MIME type returned by the server.\n * @returns {Promiserequest.throttle
is true and the request does not have high enough priority.\n */\nResource.patch = function (options) {\n const resource = new Resource(options);\n return resource.patch(options.data, {\n // Make copy of just the needed fields because headers can be passed to both the constructor and to post\n responseType: options.responseType,\n overrideMimeType: options.overrideMimeType,\n });\n};\n\n/**\n * Contains implementations of functions that can be replaced for testing\n *\n * @private\n */\nResource._Implementations = {};\n\nResource._Implementations.loadImageElement = function (\n url,\n crossOrigin,\n deferred,\n) {\n const image = new Image();\n\n image.onload = function () {\n // work-around a known issue with Firefox and dimensionless SVG, see:\n // - https://github.com/whatwg/html/issues/3510\n // - https://bugzilla.mozilla.org/show_bug.cgi?id=700533\n if (\n image.naturalWidth === 0 &&\n image.naturalHeight === 0 &&\n image.width === 0 &&\n image.height === 0\n ) {\n // these values affect rasterization and will likely mar the content\n // until Firefox takes a stance on the issue, marred content is better than no content\n // Chromium uses a more refined heuristic about its choice given nil viewBox, and a better stance and solution is\n // proposed later in the original issue thread:\n // - Chromium behavior: https://github.com/CesiumGS/cesium/issues/9188#issuecomment-704400825\n // - Cesium's stance/solve: https://github.com/CesiumGS/cesium/issues/9188#issuecomment-720645777\n image.width = 300;\n image.height = 150;\n }\n deferred.resolve(image);\n };\n\n image.onerror = function (e) {\n deferred.reject(e);\n };\n\n if (crossOrigin) {\n if (TrustedServers.contains(url)) {\n image.crossOrigin = \"use-credentials\";\n } else {\n image.crossOrigin = \"\";\n }\n }\n\n image.src = url;\n};\n\nResource._Implementations.createImage = function (\n request,\n crossOrigin,\n deferred,\n flipY,\n skipColorSpaceConversion,\n preferImageBitmap,\n) {\n const url = request.url;\n // Passing an Image to createImageBitmap will force it to run on the main thread\n // since DOM elements don't exist on workers. We convert it to a blob so it's non-blocking.\n // See:\n // https://bugzilla.mozilla.org/show_bug.cgi?id=1044102#c38\n // https://bugs.chromium.org/p/chromium/issues/detail?id=580202#c10\n Resource.supportsImageBitmapOptions()\n .then(function (supportsImageBitmap) {\n // We can only use ImageBitmap if we can flip on decode.\n // See: https://github.com/CesiumGS/cesium/pull/7579#issuecomment-466146898\n if (!(supportsImageBitmap && preferImageBitmap)) {\n Resource._Implementations.loadImageElement(url, crossOrigin, deferred);\n return;\n }\n const responseType = \"blob\";\n const method = \"GET\";\n const xhrDeferred = defer();\n const xhr = Resource._Implementations.loadWithXhr(\n url,\n responseType,\n method,\n undefined,\n undefined,\n xhrDeferred,\n undefined,\n undefined,\n undefined,\n );\n\n if (defined(xhr) && defined(xhr.abort)) {\n request.cancelFunction = function () {\n xhr.abort();\n };\n }\n return xhrDeferred.promise\n .then(function (blob) {\n if (!defined(blob)) {\n deferred.reject(\n new RuntimeError(\n `Successfully retrieved ${url} but it contained no content.`,\n ),\n );\n return;\n }\n\n return Resource.createImageBitmapFromBlob(blob, {\n flipY: flipY,\n premultiplyAlpha: false,\n skipColorSpaceConversion: skipColorSpaceConversion,\n });\n })\n .then(function (image) {\n deferred.resolve(image);\n });\n })\n .catch(function (e) {\n deferred.reject(e);\n });\n};\n\n/**\n * Wrapper for createImageBitmap\n *\n * @private\n */\nResource.createImageBitmapFromBlob = function (blob, options) {\n Check.defined(\"options\", options);\n Check.typeOf.bool(\"options.flipY\", options.flipY);\n Check.typeOf.bool(\"options.premultiplyAlpha\", options.premultiplyAlpha);\n Check.typeOf.bool(\n \"options.skipColorSpaceConversion\",\n options.skipColorSpaceConversion,\n );\n\n return createImageBitmap(blob, {\n imageOrientation: options.flipY ? \"flipY\" : \"none\",\n premultiplyAlpha: options.premultiplyAlpha ? \"premultiply\" : \"none\",\n colorSpaceConversion: options.skipColorSpaceConversion ? \"none\" : \"default\",\n });\n};\n\nfunction loadWithHttpRequest(\n url,\n responseType,\n method,\n data,\n headers,\n deferred,\n overrideMimeType,\n) {\n // Note: only the 'json' and 'text' responseTypes transforms the loaded buffer\n fetch(url, {\n method,\n headers,\n })\n .then(async (response) => {\n if (!response.ok) {\n const responseHeaders = {};\n response.headers.forEach((value, key) => {\n responseHeaders[key] = value;\n });\n deferred.reject(\n new RequestErrorEvent(response.status, response, responseHeaders),\n );\n return;\n }\n\n switch (responseType) {\n case \"text\":\n deferred.resolve(response.text());\n break;\n case \"json\":\n deferred.resolve(response.json());\n break;\n default:\n deferred.resolve(new Uint8Array(await response.arrayBuffer()).buffer);\n break;\n }\n })\n .catch(() => {\n deferred.reject(new RequestErrorEvent());\n });\n}\n\nconst noXMLHttpRequest = typeof XMLHttpRequest === \"undefined\";\nResource._Implementations.loadWithXhr = function (\n url,\n responseType,\n method,\n data,\n headers,\n deferred,\n overrideMimeType,\n) {\n const dataUriRegexResult = dataUriRegex.exec(url);\n if (dataUriRegexResult !== null) {\n deferred.resolve(decodeDataUri(dataUriRegexResult, responseType));\n return;\n }\n\n if (noXMLHttpRequest) {\n loadWithHttpRequest(\n url,\n responseType,\n method,\n data,\n headers,\n deferred,\n overrideMimeType,\n );\n return;\n }\n\n const xhr = new XMLHttpRequest();\n\n if (TrustedServers.contains(url)) {\n xhr.withCredentials = true;\n }\n\n xhr.open(method, url, true);\n\n if (defined(overrideMimeType) && defined(xhr.overrideMimeType)) {\n xhr.overrideMimeType(overrideMimeType);\n }\n\n if (defined(headers)) {\n for (const key in headers) {\n if (headers.hasOwnProperty(key)) {\n xhr.setRequestHeader(key, headers[key]);\n }\n }\n }\n\n if (defined(responseType)) {\n xhr.responseType = responseType;\n }\n\n // While non-standard, file protocol always returns a status of 0 on success\n let localFile = false;\n if (typeof url === \"string\") {\n localFile =\n url.indexOf(\"file://\") === 0 ||\n (typeof window !== \"undefined\" && window.location.origin === \"file://\");\n }\n\n xhr.onload = function () {\n if (\n (xhr.status < 200 || xhr.status >= 300) &&\n !(localFile && xhr.status === 0)\n ) {\n deferred.reject(\n new RequestErrorEvent(\n xhr.status,\n xhr.response,\n xhr.getAllResponseHeaders(),\n ),\n );\n return;\n }\n\n const response = xhr.response;\n const browserResponseType = xhr.responseType;\n\n if (method === \"HEAD\" || method === \"OPTIONS\") {\n const responseHeaderString = xhr.getAllResponseHeaders();\n const splitHeaders = responseHeaderString.trim().split(/[\\r\\n]+/);\n\n const responseHeaders = {};\n splitHeaders.forEach(function (line) {\n const parts = line.split(\": \");\n const header = parts.shift();\n responseHeaders[header] = parts.join(\": \");\n });\n\n deferred.resolve(responseHeaders);\n return;\n }\n\n //All modern browsers will go into either the first or second if block or last else block.\n //Other code paths support older browsers that either do not support the supplied responseType\n //or do not support the xhr.response property.\n if (xhr.status === 204) {\n // accept no content\n deferred.resolve(undefined);\n } else if (\n defined(response) &&\n (!defined(responseType) || browserResponseType === responseType)\n ) {\n deferred.resolve(response);\n } else if (responseType === \"json\" && typeof response === \"string\") {\n try {\n deferred.resolve(JSON.parse(response));\n } catch (e) {\n deferred.reject(e);\n }\n } else if (\n (browserResponseType === \"\" || browserResponseType === \"document\") &&\n defined(xhr.responseXML) &&\n xhr.responseXML.hasChildNodes()\n ) {\n deferred.resolve(xhr.responseXML);\n } else if (\n (browserResponseType === \"\" || browserResponseType === \"text\") &&\n defined(xhr.responseText)\n ) {\n deferred.resolve(xhr.responseText);\n } else {\n deferred.reject(\n new RuntimeError(\"Invalid XMLHttpRequest response type.\"),\n );\n }\n };\n\n xhr.onerror = function (e) {\n deferred.reject(new RequestErrorEvent());\n };\n\n xhr.send(data);\n\n return xhr;\n};\n\nResource._Implementations.loadAndExecuteScript = function (\n url,\n functionName,\n deferred,\n) {\n return loadAndExecuteScript(url, functionName).catch(function (e) {\n deferred.reject(e);\n });\n};\n\n/**\n * The default implementations\n *\n * @private\n */\nResource._DefaultImplementations = {};\nResource._DefaultImplementations.createImage =\n Resource._Implementations.createImage;\nResource._DefaultImplementations.loadWithXhr =\n Resource._Implementations.loadWithXhr;\nResource._DefaultImplementations.loadAndExecuteScript =\n Resource._Implementations.loadAndExecuteScript;\n\n/**\n * A resource instance initialized to the current browser location\n *\n * @type {Resource}\n * @constant\n */\nResource.DEFAULT = Object.freeze(\n new Resource({\n url:\n typeof document === \"undefined\"\n ? \"\"\n : document.location.href.split(\"?\")[0],\n }),\n);\n\n/**\n * A function that returns the value of the property.\n * @callback Resource.RetryCallback\n *\n * @param {Resource} [resource] The resource that failed to load.\n * @param {RequestErrorEvent} [error] The error that occurred during the loading of the resource.\n * @returns {boolean|Promisetrue
is preferable for requests going through HTTP/1 servers.\n *\n * @type {boolean}\n * @readonly\n *\n * @default false\n */\n this.throttleByServer = throttleByServer;\n\n /**\n * Type of request.\n *\n * @type {RequestType}\n * @readonly\n *\n * @default RequestType.OTHER\n */\n this.type = defaultValue(options.type, RequestType.OTHER);\n\n /**\n * A key used to identify the server that a request is going to. It is derived from the url's authority and scheme.\n *\n * @type {string}\n *\n * @private\n */\n this.serverKey = options.serverKey;\n\n /**\n * The current state of the request.\n *\n * @type {RequestState}\n * @readonly\n */\n this.state = RequestState.UNISSUED;\n\n /**\n * The requests's deferred promise.\n *\n * @type {object}\n *\n * @private\n */\n this.deferred = undefined;\n\n /**\n * Whether the request was explicitly cancelled.\n *\n * @type {boolean}\n *\n * @private\n */\n this.cancelled = false;\n}\n\n/**\n * Mark the request as cancelled.\n *\n * @private\n */\nRequest.prototype.cancel = function () {\n this.cancelled = true;\n};\n\n/**\n * Duplicates a Request instance.\n *\n * @param {Request} [result] The object onto which to store the result.\n *\n * @returns {Request} The modified result parameter or a new Resource instance if one was not provided.\n */\nRequest.prototype.clone = function (result) {\n if (!defined(result)) {\n return new Request(this);\n }\n\n result.url = this.url;\n result.requestFunction = this.requestFunction;\n result.cancelFunction = this.cancelFunction;\n result.priorityFunction = this.priorityFunction;\n result.priority = this.priority;\n result.throttle = this.throttle;\n result.throttleByServer = this.throttleByServer;\n result.type = this.type;\n result.serverKey = this.serverKey;\n\n // These get defaulted because the cloned request hasn't been issued\n result.state = RequestState.UNISSUED;\n result.deferred = undefined;\n result.cancelled = false;\n\n return result;\n};\n\n/**\n * The function that makes the actual data request.\n * @callback Request.RequestCallback\n * @returns {PromisemaximumRequestsPerServer
.\n * Useful when streaming data from a known HTTP/2 or HTTP/3 server.\n * @type {object}\n *\n * @example\n * RequestScheduler.requestsByServer[\"myserver.com:443\"] = 18;\n *\n * @example\n * RequestScheduler.requestsByServer = {\n * \"api.cesium.com:443\": 18,\n * \"assets.cesium.com:443\": 18,\n * };\n */\nRequestScheduler.requestsByServer = {};\n\n/**\n * Specifies if the request scheduler should throttle incoming requests, or let the browser queue requests under its control.\n * @type {boolean}\n * @default true\n */\nRequestScheduler.throttleRequests = true;\n\n/**\n * When true, log statistics to the console every frame\n * @type {boolean}\n * @default false\n * @private\n */\nRequestScheduler.debugShowStatistics = false;\n\n/**\n * An event that's raised when a request is completed. Event handlers are passed\n * the error object if the request fails.\n *\n * @type {Event}\n * @default Event()\n * @private\n */\nRequestScheduler.requestCompletedEvent = requestCompletedEvent;\n\nObject.defineProperties(RequestScheduler, {\n /**\n * Returns the statistics used by the request scheduler.\n *\n * @memberof RequestScheduler\n *\n * @type {object}\n * @readonly\n * @private\n */\n statistics: {\n get: function () {\n return statistics;\n },\n },\n\n /**\n * The maximum size of the priority heap. This limits the number of requests that are sorted by priority. Only applies to requests that are not yet active.\n *\n * @memberof RequestScheduler\n *\n * @type {number}\n * @default 20\n * @private\n */\n priorityHeapLength: {\n get: function () {\n return priorityHeapLength;\n },\n set: function (value) {\n // If the new length shrinks the heap, need to cancel some of the requests.\n // Since this value is not intended to be tweaked regularly it is fine to just cancel the high priority requests.\n if (value < priorityHeapLength) {\n while (requestHeap.length > value) {\n const request = requestHeap.pop();\n cancelRequest(request);\n }\n }\n priorityHeapLength = value;\n requestHeap.maximumLength = value;\n requestHeap.reserve(value);\n },\n },\n});\n\nfunction updatePriority(request) {\n if (defined(request.priorityFunction)) {\n request.priority = request.priorityFunction();\n }\n}\n\n/**\n * Check if there are open slots for a particular server key. If desiredRequests is greater than 1, this checks if the queue has room for scheduling multiple requests.\n * @param {string} serverKey The server key returned by {@link RequestScheduler.getServerKey}.\n * @param {number} [desiredRequests=1] How many requests the caller plans to request\n * @return {boolean} True if there are enough open slots for desiredRequests
more requests.\n * @private\n */\nRequestScheduler.serverHasOpenSlots = function (serverKey, desiredRequests) {\n desiredRequests = defaultValue(desiredRequests, 1);\n\n const maxRequests = defaultValue(\n RequestScheduler.requestsByServer[serverKey],\n RequestScheduler.maximumRequestsPerServer,\n );\n const hasOpenSlotsServer =\n numberOfActiveRequestsByServer[serverKey] + desiredRequests <= maxRequests;\n\n return hasOpenSlotsServer;\n};\n\n/**\n * Check if the priority heap has open slots, regardless of which server they\n * are from. This is used in {@link Multiple3DTileContent} for determining when\n * all requests can be scheduled\n * @param {number} desiredRequests The number of requests the caller intends to make\n * @return {boolean} true
if the heap has enough available slots to meet the desiredRequests. false
otherwise.\n *\n * @private\n */\nRequestScheduler.heapHasOpenSlots = function (desiredRequests) {\n const hasOpenSlotsHeap =\n requestHeap.length + desiredRequests <= priorityHeapLength;\n return hasOpenSlotsHeap;\n};\n\nfunction issueRequest(request) {\n if (request.state === RequestState.UNISSUED) {\n request.state = RequestState.ISSUED;\n request.deferred = defer();\n }\n return request.deferred.promise;\n}\n\nfunction getRequestReceivedFunction(request) {\n return function (results) {\n if (request.state === RequestState.CANCELLED) {\n // If the data request comes back but the request is cancelled, ignore it.\n return;\n }\n // explicitly set to undefined to ensure GC of request response data. See #8843\n const deferred = request.deferred;\n\n --statistics.numberOfActiveRequests;\n --numberOfActiveRequestsByServer[request.serverKey];\n requestCompletedEvent.raiseEvent();\n request.state = RequestState.RECEIVED;\n request.deferred = undefined;\n\n deferred.resolve(results);\n };\n}\n\nfunction getRequestFailedFunction(request) {\n return function (error) {\n if (request.state === RequestState.CANCELLED) {\n // If the data request comes back but the request is cancelled, ignore it.\n return;\n }\n ++statistics.numberOfFailedRequests;\n --statistics.numberOfActiveRequests;\n --numberOfActiveRequestsByServer[request.serverKey];\n requestCompletedEvent.raiseEvent(error);\n request.state = RequestState.FAILED;\n request.deferred.reject(error);\n };\n}\n\nfunction startRequest(request) {\n const promise = issueRequest(request);\n request.state = RequestState.ACTIVE;\n activeRequests.push(request);\n ++statistics.numberOfActiveRequests;\n ++statistics.numberOfActiveRequestsEver;\n ++numberOfActiveRequestsByServer[request.serverKey];\n request\n .requestFunction()\n .then(getRequestReceivedFunction(request))\n .catch(getRequestFailedFunction(request));\n return promise;\n}\n\nfunction cancelRequest(request) {\n const active = request.state === RequestState.ACTIVE;\n request.state = RequestState.CANCELLED;\n ++statistics.numberOfCancelledRequests;\n // check that deferred has not been cleared since cancelRequest can be called\n // on a finished request, e.g. by clearForSpecs during tests\n if (defined(request.deferred)) {\n const deferred = request.deferred;\n request.deferred = undefined;\n deferred.reject();\n }\n\n if (active) {\n --statistics.numberOfActiveRequests;\n --numberOfActiveRequestsByServer[request.serverKey];\n ++statistics.numberOfCancelledActiveRequests;\n }\n\n if (defined(request.cancelFunction)) {\n request.cancelFunction();\n }\n}\n\n/**\n * Sort requests by priority and start requests.\n * @private\n */\nRequestScheduler.update = function () {\n let i;\n let request;\n\n // Loop over all active requests. Cancelled, failed, or received requests are removed from the array to make room for new requests.\n let removeCount = 0;\n const activeLength = activeRequests.length;\n for (i = 0; i < activeLength; ++i) {\n request = activeRequests[i];\n if (request.cancelled) {\n // Request was explicitly cancelled\n cancelRequest(request);\n }\n if (request.state !== RequestState.ACTIVE) {\n // Request is no longer active, remove from array\n ++removeCount;\n continue;\n }\n if (removeCount > 0) {\n // Shift back to fill in vacated slots from completed requests\n activeRequests[i - removeCount] = request;\n }\n }\n activeRequests.length -= removeCount;\n\n // Update priority of issued requests and resort the heap\n const issuedRequests = requestHeap.internalArray;\n const issuedLength = requestHeap.length;\n for (i = 0; i < issuedLength; ++i) {\n updatePriority(issuedRequests[i]);\n }\n requestHeap.resort();\n\n // Get the number of open slots and fill with the highest priority requests.\n // Un-throttled requests are automatically added to activeRequests, so activeRequests.length may exceed maximumRequests\n const openSlots = Math.max(\n RequestScheduler.maximumRequests - activeRequests.length,\n 0,\n );\n let filledSlots = 0;\n while (filledSlots < openSlots && requestHeap.length > 0) {\n // Loop until all open slots are filled or the heap becomes empty\n request = requestHeap.pop();\n if (request.cancelled) {\n // Request was explicitly cancelled\n cancelRequest(request);\n continue;\n }\n\n if (\n request.throttleByServer &&\n !RequestScheduler.serverHasOpenSlots(request.serverKey)\n ) {\n // Open slots are available, but the request is throttled by its server. Cancel and try again later.\n cancelRequest(request);\n continue;\n }\n\n startRequest(request);\n ++filledSlots;\n }\n\n updateStatistics();\n};\n\n/**\n * Get the server key from a given url.\n *\n * @param {string} url The url.\n * @returns {string} The server key.\n * @private\n */\nRequestScheduler.getServerKey = function (url) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.string(\"url\", url);\n //>>includeEnd('debug');\n\n let uri = new Uri(url);\n if (uri.scheme() === \"\") {\n uri = uri.absoluteTo(pageUri);\n uri.normalize();\n }\n\n let serverKey = uri.authority();\n if (!/:/.test(serverKey)) {\n // If the authority does not contain a port number, add port 443 for https or port 80 for http\n serverKey = `${serverKey}:${uri.scheme() === \"https\" ? \"443\" : \"80\"}`;\n }\n\n const length = numberOfActiveRequestsByServer[serverKey];\n if (!defined(length)) {\n numberOfActiveRequestsByServer[serverKey] = 0;\n }\n\n return serverKey;\n};\n\n/**\n * Issue a request. If request.throttle is false, the request is sent immediately. Otherwise the request will be\n * queued and sorted by priority before being sent.\n *\n * @param {Request} request The request object.\n *\n * @returns {Promise|undefined} A Promise for the requested data, or undefined if this request does not have high enough priority to be issued.\n *\n * @private\n */\nRequestScheduler.request = function (request) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"request\", request);\n Check.typeOf.string(\"request.url\", request.url);\n Check.typeOf.func(\"request.requestFunction\", request.requestFunction);\n //>>includeEnd('debug');\n\n if (isDataUri(request.url) || isBlobUri(request.url)) {\n requestCompletedEvent.raiseEvent();\n request.state = RequestState.RECEIVED;\n return request.requestFunction();\n }\n\n ++statistics.numberOfAttemptedRequests;\n\n if (!defined(request.serverKey)) {\n request.serverKey = RequestScheduler.getServerKey(request.url);\n }\n\n if (\n RequestScheduler.throttleRequests &&\n request.throttleByServer &&\n !RequestScheduler.serverHasOpenSlots(request.serverKey)\n ) {\n // Server is saturated. Try again later.\n return undefined;\n }\n\n if (!RequestScheduler.throttleRequests || !request.throttle) {\n return startRequest(request);\n }\n\n if (activeRequests.length >= RequestScheduler.maximumRequests) {\n // Active requests are saturated. Try again later.\n return undefined;\n }\n\n // Insert into the priority heap and see if a request was bumped off. If this request is the lowest\n // priority it will be returned.\n updatePriority(request);\n const removedRequest = requestHeap.insert(request);\n\n if (defined(removedRequest)) {\n if (removedRequest === request) {\n // Request does not have high enough priority to be issued\n return undefined;\n }\n // A previously issued request has been bumped off the priority heap, so cancel it\n cancelRequest(removedRequest);\n }\n\n return issueRequest(request);\n};\n\nfunction updateStatistics() {\n if (!RequestScheduler.debugShowStatistics) {\n return;\n }\n\n if (\n statistics.numberOfActiveRequests === 0 &&\n statistics.lastNumberOfActiveRequests > 0\n ) {\n if (statistics.numberOfAttemptedRequests > 0) {\n console.log(\n `Number of attempted requests: ${statistics.numberOfAttemptedRequests}`,\n );\n statistics.numberOfAttemptedRequests = 0;\n }\n\n if (statistics.numberOfCancelledRequests > 0) {\n console.log(\n `Number of cancelled requests: ${statistics.numberOfCancelledRequests}`,\n );\n statistics.numberOfCancelledRequests = 0;\n }\n\n if (statistics.numberOfCancelledActiveRequests > 0) {\n console.log(\n `Number of cancelled active requests: ${statistics.numberOfCancelledActiveRequests}`,\n );\n statistics.numberOfCancelledActiveRequests = 0;\n }\n\n if (statistics.numberOfFailedRequests > 0) {\n console.log(\n `Number of failed requests: ${statistics.numberOfFailedRequests}`,\n );\n statistics.numberOfFailedRequests = 0;\n }\n }\n\n statistics.lastNumberOfActiveRequests = statistics.numberOfActiveRequests;\n}\n\n/**\n * For testing only. Clears any requests that may not have completed from previous tests.\n *\n * @private\n */\nRequestScheduler.clearForSpecs = function () {\n while (requestHeap.length > 0) {\n const request = requestHeap.pop();\n cancelRequest(request);\n }\n const length = activeRequests.length;\n for (let i = 0; i < length; ++i) {\n cancelRequest(activeRequests[i]);\n }\n activeRequests.length = 0;\n numberOfActiveRequestsByServer = {};\n\n // Clear stats\n statistics.numberOfAttemptedRequests = 0;\n statistics.numberOfActiveRequests = 0;\n statistics.numberOfCancelledRequests = 0;\n statistics.numberOfCancelledActiveRequests = 0;\n statistics.numberOfFailedRequests = 0;\n statistics.numberOfActiveRequestsEver = 0;\n statistics.lastNumberOfActiveRequests = 0;\n};\n\n/**\n * For testing only.\n *\n * @private\n */\nRequestScheduler.numberOfActiveRequestsByServer = function (serverKey) {\n return numberOfActiveRequestsByServer[serverKey];\n};\n\n/**\n * For testing only.\n *\n * @private\n */\nRequestScheduler.requestHeap = requestHeap;\nexport default RequestScheduler;\n","import Check from \"./Check.js\";\nimport defined from \"./defined.js\";\n\n/**\n * A generic utility class for managing subscribers for a particular event.\n * This class is usually instantiated inside of a container class and\n * exposed as a property for others to subscribe to.\n *\n * @alias Event\n * @template Listener extends (...args: any[]) => void = (...args: any[]) => void\n * @constructor\n * @example\n * MyObject.prototype.myListener = function(arg1, arg2) {\n * this.myArg1Copy = arg1;\n * this.myArg2Copy = arg2;\n * }\n *\n * const myObjectInstance = new MyObject();\n * const evt = new Cesium.Event();\n * evt.addEventListener(MyObject.prototype.myListener, myObjectInstance);\n * evt.raiseEvent('1', '2');\n * evt.removeEventListener(MyObject.prototype.myListener);\n */\nfunction Event() {\n this._listeners = [];\n this._scopes = [];\n this._toRemove = [];\n this._insideRaiseEvent = false;\n}\n\nObject.defineProperties(Event.prototype, {\n /**\n * The number of listeners currently subscribed to the event.\n * @memberof Event.prototype\n * @type {number}\n * @readonly\n */\n numberOfListeners: {\n get: function () {\n return this._listeners.length - this._toRemove.length;\n },\n },\n});\n\n/**\n * Registers a callback function to be executed whenever the event is raised.\n * An optional scope can be provided to serve as the this
pointer\n * in which the function will execute.\n *\n * @param {Listener} listener The function to be executed when the event is raised.\n * @param {object} [scope] An optional object scope to serve as the this
\n * pointer in which the listener function will execute.\n * @returns {Event.RemoveCallback} A function that will remove this event listener when invoked.\n *\n * @see Event#raiseEvent\n * @see Event#removeEventListener\n */\nEvent.prototype.addEventListener = function (listener, scope) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.func(\"listener\", listener);\n //>>includeEnd('debug');\n\n this._listeners.push(listener);\n this._scopes.push(scope);\n\n const event = this;\n return function () {\n event.removeEventListener(listener, scope);\n };\n};\n\n/**\n * Unregisters a previously registered callback.\n *\n * @param {Listener} listener The function to be unregistered.\n * @param {object} [scope] The scope that was originally passed to addEventListener.\n * @returns {boolean} true
if the listener was removed; false
if the listener and scope are not registered with the event.\n *\n * @see Event#addEventListener\n * @see Event#raiseEvent\n */\nEvent.prototype.removeEventListener = function (listener, scope) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.func(\"listener\", listener);\n //>>includeEnd('debug');\n\n const listeners = this._listeners;\n const scopes = this._scopes;\n\n let index = -1;\n for (let i = 0; i < listeners.length; i++) {\n if (listeners[i] === listener && scopes[i] === scope) {\n index = i;\n break;\n }\n }\n\n if (index !== -1) {\n if (this._insideRaiseEvent) {\n //In order to allow removing an event subscription from within\n //a callback, we don't actually remove the items here. Instead\n //remember the index they are at and undefined their value.\n this._toRemove.push(index);\n listeners[index] = undefined;\n scopes[index] = undefined;\n } else {\n listeners.splice(index, 1);\n scopes.splice(index, 1);\n }\n return true;\n }\n\n return false;\n};\n\nfunction compareNumber(a, b) {\n return b - a;\n}\n\n/**\n * Raises the event by calling each registered listener with all supplied arguments.\n *\n * @param {...Parameterstrue
if they are equal, false
otherwise.\n *\n * @param {HeadingPitchRoll} [left] The first HeadingPitchRoll.\n * @param {HeadingPitchRoll} [right] The second HeadingPitchRoll.\n * @returns {boolean} true
if left and right are equal, false
otherwise.\n */\nHeadingPitchRoll.equals = function (left, right) {\n return (\n left === right ||\n (defined(left) &&\n defined(right) &&\n left.heading === right.heading &&\n left.pitch === right.pitch &&\n left.roll === right.roll)\n );\n};\n\n/**\n * Compares the provided HeadingPitchRolls componentwise and returns\n * true
if they pass an absolute or relative tolerance test,\n * false
otherwise.\n *\n * @param {HeadingPitchRoll} [left] The first HeadingPitchRoll.\n * @param {HeadingPitchRoll} [right] The second HeadingPitchRoll.\n * @param {number} [relativeEpsilon=0] The relative epsilon tolerance to use for equality testing.\n * @param {number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing.\n * @returns {boolean} true
if left and right are within the provided epsilon, false
otherwise.\n */\nHeadingPitchRoll.equalsEpsilon = function (\n left,\n right,\n relativeEpsilon,\n absoluteEpsilon,\n) {\n return (\n left === right ||\n (defined(left) &&\n defined(right) &&\n CesiumMath.equalsEpsilon(\n left.heading,\n right.heading,\n relativeEpsilon,\n absoluteEpsilon,\n ) &&\n CesiumMath.equalsEpsilon(\n left.pitch,\n right.pitch,\n relativeEpsilon,\n absoluteEpsilon,\n ) &&\n CesiumMath.equalsEpsilon(\n left.roll,\n right.roll,\n relativeEpsilon,\n absoluteEpsilon,\n ))\n );\n};\n\n/**\n * Duplicates this HeadingPitchRoll instance.\n *\n * @param {HeadingPitchRoll} [result] The object onto which to store the result.\n * @returns {HeadingPitchRoll} The modified result parameter or a new HeadingPitchRoll instance if one was not provided.\n */\nHeadingPitchRoll.prototype.clone = function (result) {\n return HeadingPitchRoll.clone(this, result);\n};\n\n/**\n * Compares this HeadingPitchRoll against the provided HeadingPitchRoll componentwise and returns\n * true
if they are equal, false
otherwise.\n *\n * @param {HeadingPitchRoll} [right] The right hand side HeadingPitchRoll.\n * @returns {boolean} true
if they are equal, false
otherwise.\n */\nHeadingPitchRoll.prototype.equals = function (right) {\n return HeadingPitchRoll.equals(this, right);\n};\n\n/**\n * Compares this HeadingPitchRoll against the provided HeadingPitchRoll componentwise and returns\n * true
if they pass an absolute or relative tolerance test,\n * false
otherwise.\n *\n * @param {HeadingPitchRoll} [right] The right hand side HeadingPitchRoll.\n * @param {number} [relativeEpsilon=0] The relative epsilon tolerance to use for equality testing.\n * @param {number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing.\n * @returns {boolean} true
if they are within the provided epsilon, false
otherwise.\n */\nHeadingPitchRoll.prototype.equalsEpsilon = function (\n right,\n relativeEpsilon,\n absoluteEpsilon,\n) {\n return HeadingPitchRoll.equalsEpsilon(\n this,\n right,\n relativeEpsilon,\n absoluteEpsilon,\n );\n};\n\n/**\n * Creates a string representing this HeadingPitchRoll in the format '(heading, pitch, roll)' in radians.\n *\n * @returns {string} A string representing the provided HeadingPitchRoll in the format '(heading, pitch, roll)'.\n */\nHeadingPitchRoll.prototype.toString = function () {\n return `(${this.heading}, ${this.pitch}, ${this.roll})`;\n};\nexport default HeadingPitchRoll;\n","import buildModuleUrl from \"./buildModuleUrl.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport Iau2006XysSample from \"./Iau2006XysSample.js\";\nimport JulianDate from \"./JulianDate.js\";\nimport Resource from \"./Resource.js\";\nimport TimeStandard from \"./TimeStandard.js\";\n\n/**\n * A set of IAU2006 XYS data that is used to evaluate the transformation between the International\n * Celestial Reference Frame (ICRF) and the International Terrestrial Reference Frame (ITRF).\n *\n * @alias Iau2006XysData\n * @constructor\n *\n * @param {object} [options] Object with the following properties:\n * @param {Resource|string} [options.xysFileUrlTemplate='Assets/IAU2006_XYS/IAU2006_XYS_{0}.json'] A template URL for obtaining the XYS data. In the template,\n * `{0}` will be replaced with the file index.\n * @param {number} [options.interpolationOrder=9] The order of interpolation to perform on the XYS data.\n * @param {number} [options.sampleZeroJulianEphemerisDate=2442396.5] The Julian ephemeris date (JED) of the\n * first XYS sample.\n * @param {number} [options.stepSizeDays=1.0] The step size, in days, between successive XYS samples.\n * @param {number} [options.samplesPerXysFile=1000] The number of samples in each XYS file.\n * @param {number} [options.totalSamples=27426] The total number of samples in all XYS files.\n *\n * @private\n */\nfunction Iau2006XysData(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n this._xysFileUrlTemplate = Resource.createIfNeeded(\n options.xysFileUrlTemplate,\n );\n this._interpolationOrder = defaultValue(options.interpolationOrder, 9);\n this._sampleZeroJulianEphemerisDate = defaultValue(\n options.sampleZeroJulianEphemerisDate,\n 2442396.5,\n );\n this._sampleZeroDateTT = new JulianDate(\n this._sampleZeroJulianEphemerisDate,\n 0.0,\n TimeStandard.TAI,\n );\n this._stepSizeDays = defaultValue(options.stepSizeDays, 1.0);\n this._samplesPerXysFile = defaultValue(options.samplesPerXysFile, 1000);\n this._totalSamples = defaultValue(options.totalSamples, 27426);\n this._samples = new Array(this._totalSamples * 3);\n this._chunkDownloadsInProgress = [];\n\n const order = this._interpolationOrder;\n\n // Compute denominators and X values for interpolation.\n const denom = (this._denominators = new Array(order + 1));\n const xTable = (this._xTable = new Array(order + 1));\n\n const stepN = Math.pow(this._stepSizeDays, order);\n\n for (let i = 0; i <= order; ++i) {\n denom[i] = stepN;\n xTable[i] = i * this._stepSizeDays;\n\n for (let j = 0; j <= order; ++j) {\n if (j !== i) {\n denom[i] *= i - j;\n }\n }\n\n denom[i] = 1.0 / denom[i];\n }\n\n // Allocate scratch arrays for interpolation.\n this._work = new Array(order + 1);\n this._coef = new Array(order + 1);\n}\n\nconst julianDateScratch = new JulianDate(0, 0.0, TimeStandard.TAI);\n\nfunction getDaysSinceEpoch(xys, dayTT, secondTT) {\n const dateTT = julianDateScratch;\n dateTT.dayNumber = dayTT;\n dateTT.secondsOfDay = secondTT;\n return JulianDate.daysDifference(dateTT, xys._sampleZeroDateTT);\n}\n\n/**\n * Preloads XYS data for a specified date range.\n *\n * @param {number} startDayTT The Julian day number of the beginning of the interval to preload, expressed in\n * the Terrestrial Time (TT) time standard.\n * @param {number} startSecondTT The seconds past noon of the beginning of the interval to preload, expressed in\n * the Terrestrial Time (TT) time standard.\n * @param {number} stopDayTT The Julian day number of the end of the interval to preload, expressed in\n * the Terrestrial Time (TT) time standard.\n * @param {number} stopSecondTT The seconds past noon of the end of the interval to preload, expressed in\n * the Terrestrial Time (TT) time standard.\n * @returns {PromiseThis will compute quaternions that ensure a squad curve is C1.
\n *\n * @param {Quaternion} q0 The first quaternion.\n * @param {Quaternion} q1 The second quaternion.\n * @param {Quaternion} q2 The third quaternion.\n * @param {Quaternion} result The object onto which to store the result.\n * @returns {Quaternion} The modified result parameter.\n *\n * @see Quaternion#squad\n */\nQuaternion.computeInnerQuadrangle = function (q0, q1, q2, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"q0\", q0);\n Check.typeOf.object(\"q1\", q1);\n Check.typeOf.object(\"q2\", q2);\n Check.typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n\n const qInv = Quaternion.conjugate(q1, squadScratchQuaternion0);\n Quaternion.multiply(qInv, q2, squadScratchQuaternion1);\n const cart0 = Quaternion.log(squadScratchQuaternion1, squadScratchCartesian0);\n\n Quaternion.multiply(qInv, q0, squadScratchQuaternion1);\n const cart1 = Quaternion.log(squadScratchQuaternion1, squadScratchCartesian1);\n\n Cartesian3.add(cart0, cart1, cart0);\n Cartesian3.multiplyByScalar(cart0, 0.25, cart0);\n Cartesian3.negate(cart0, cart0);\n Quaternion.exp(cart0, squadScratchQuaternion0);\n\n return Quaternion.multiply(q1, squadScratchQuaternion0, result);\n};\n\n/**\n * Computes the spherical quadrangle interpolation between quaternions.\n *\n * @param {Quaternion} q0 The first quaternion.\n * @param {Quaternion} q1 The second quaternion.\n * @param {Quaternion} s0 The first inner quadrangle.\n * @param {Quaternion} s1 The second inner quadrangle.\n * @param {number} t The time in [0,1] used to interpolate.\n * @param {Quaternion} result The object onto which to store the result.\n * @returns {Quaternion} The modified result parameter.\n *\n *\n * @example\n * // 1. compute the squad interpolation between two quaternions on a curve\n * const s0 = Cesium.Quaternion.computeInnerQuadrangle(quaternions[i - 1], quaternions[i], quaternions[i + 1], new Cesium.Quaternion());\n * const s1 = Cesium.Quaternion.computeInnerQuadrangle(quaternions[i], quaternions[i + 1], quaternions[i + 2], new Cesium.Quaternion());\n * const q = Cesium.Quaternion.squad(quaternions[i], quaternions[i + 1], s0, s1, t, new Cesium.Quaternion());\n *\n * // 2. compute the squad interpolation as above but where the first quaternion is a end point.\n * const s1 = Cesium.Quaternion.computeInnerQuadrangle(quaternions[0], quaternions[1], quaternions[2], new Cesium.Quaternion());\n * const q = Cesium.Quaternion.squad(quaternions[0], quaternions[1], quaternions[0], s1, t, new Cesium.Quaternion());\n *\n * @see Quaternion#computeInnerQuadrangle\n */\nQuaternion.squad = function (q0, q1, s0, s1, t, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"q0\", q0);\n Check.typeOf.object(\"q1\", q1);\n Check.typeOf.object(\"s0\", s0);\n Check.typeOf.object(\"s1\", s1);\n Check.typeOf.number(\"t\", t);\n Check.typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n\n const slerp0 = Quaternion.slerp(q0, q1, t, squadScratchQuaternion0);\n const slerp1 = Quaternion.slerp(s0, s1, t, squadScratchQuaternion1);\n return Quaternion.slerp(slerp0, slerp1, 2.0 * t * (1.0 - t), result);\n};\n\nconst fastSlerpScratchQuaternion = new Quaternion();\n// eslint-disable-next-line no-loss-of-precision\nconst opmu = 1.90110745351730037;\nconst u = FeatureDetection.supportsTypedArrays() ? new Float32Array(8) : [];\nconst v = FeatureDetection.supportsTypedArrays() ? new Float32Array(8) : [];\nconst bT = FeatureDetection.supportsTypedArrays() ? new Float32Array(8) : [];\nconst bD = FeatureDetection.supportsTypedArrays() ? new Float32Array(8) : [];\n\nfor (let i = 0; i < 7; ++i) {\n const s = i + 1.0;\n const t = 2.0 * s + 1.0;\n u[i] = 1.0 / (s * t);\n v[i] = s / t;\n}\n\nu[7] = opmu / (8.0 * 17.0);\nv[7] = (opmu * 8.0) / 17.0;\n\n/**\n * Computes the spherical linear interpolation or extrapolation at t using the provided quaternions.\n * This implementation is faster than {@link Quaternion#slerp}, but is only accurate up to 10-6.\n *\n * @param {Quaternion} start The value corresponding to t at 0.0.\n * @param {Quaternion} end The value corresponding to t at 1.0.\n * @param {number} t The point along t at which to interpolate.\n * @param {Quaternion} result The object onto which to store the result.\n * @returns {Quaternion} The modified result parameter.\n *\n * @see Quaternion#slerp\n */\nQuaternion.fastSlerp = function (start, end, t, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"start\", start);\n Check.typeOf.object(\"end\", end);\n Check.typeOf.number(\"t\", t);\n Check.typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n\n let x = Quaternion.dot(start, end);\n\n let sign;\n if (x >= 0) {\n sign = 1.0;\n } else {\n sign = -1.0;\n x = -x;\n }\n\n const xm1 = x - 1.0;\n const d = 1.0 - t;\n const sqrT = t * t;\n const sqrD = d * d;\n\n for (let i = 7; i >= 0; --i) {\n bT[i] = (u[i] * sqrT - v[i]) * xm1;\n bD[i] = (u[i] * sqrD - v[i]) * xm1;\n }\n\n const cT =\n sign *\n t *\n (1.0 +\n bT[0] *\n (1.0 +\n bT[1] *\n (1.0 +\n bT[2] *\n (1.0 +\n bT[3] *\n (1.0 +\n bT[4] *\n (1.0 + bT[5] * (1.0 + bT[6] * (1.0 + bT[7]))))))));\n const cD =\n d *\n (1.0 +\n bD[0] *\n (1.0 +\n bD[1] *\n (1.0 +\n bD[2] *\n (1.0 +\n bD[3] *\n (1.0 +\n bD[4] *\n (1.0 + bD[5] * (1.0 + bD[6] * (1.0 + bD[7]))))))));\n\n const temp = Quaternion.multiplyByScalar(\n start,\n cD,\n fastSlerpScratchQuaternion,\n );\n Quaternion.multiplyByScalar(end, cT, result);\n return Quaternion.add(temp, result, result);\n};\n\n/**\n * Computes the spherical quadrangle interpolation between quaternions.\n * An implementation that is faster than {@link Quaternion#squad}, but less accurate.\n *\n * @param {Quaternion} q0 The first quaternion.\n * @param {Quaternion} q1 The second quaternion.\n * @param {Quaternion} s0 The first inner quadrangle.\n * @param {Quaternion} s1 The second inner quadrangle.\n * @param {number} t The time in [0,1] used to interpolate.\n * @param {Quaternion} result The object onto which to store the result.\n * @returns {Quaternion} The modified result parameter or a new instance if none was provided.\n *\n * @see Quaternion#squad\n */\nQuaternion.fastSquad = function (q0, q1, s0, s1, t, result) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"q0\", q0);\n Check.typeOf.object(\"q1\", q1);\n Check.typeOf.object(\"s0\", s0);\n Check.typeOf.object(\"s1\", s1);\n Check.typeOf.number(\"t\", t);\n Check.typeOf.object(\"result\", result);\n //>>includeEnd('debug');\n\n const slerp0 = Quaternion.fastSlerp(q0, q1, t, squadScratchQuaternion0);\n const slerp1 = Quaternion.fastSlerp(s0, s1, t, squadScratchQuaternion1);\n return Quaternion.fastSlerp(slerp0, slerp1, 2.0 * t * (1.0 - t), result);\n};\n\n/**\n * Compares the provided quaternions componentwise and returns\n *true
if they are equal, false
otherwise.\n *\n * @param {Quaternion} [left] The first quaternion.\n * @param {Quaternion} [right] The second quaternion.\n * @returns {boolean} true
if left and right are equal, false
otherwise.\n */\nQuaternion.equals = function (left, right) {\n return (\n left === right ||\n (defined(left) &&\n defined(right) &&\n left.x === right.x &&\n left.y === right.y &&\n left.z === right.z &&\n left.w === right.w)\n );\n};\n\n/**\n * Compares the provided quaternions componentwise and returns\n * true
if they are within the provided epsilon,\n * false
otherwise.\n *\n * @param {Quaternion} [left] The first quaternion.\n * @param {Quaternion} [right] The second quaternion.\n * @param {number} [epsilon=0] The epsilon to use for equality testing.\n * @returns {boolean} true
if left and right are within the provided epsilon, false
otherwise.\n */\nQuaternion.equalsEpsilon = function (left, right, epsilon) {\n epsilon = defaultValue(epsilon, 0);\n\n return (\n left === right ||\n (defined(left) &&\n defined(right) &&\n Math.abs(left.x - right.x) <= epsilon &&\n Math.abs(left.y - right.y) <= epsilon &&\n Math.abs(left.z - right.z) <= epsilon &&\n Math.abs(left.w - right.w) <= epsilon)\n );\n};\n\n/**\n * An immutable Quaternion instance initialized to (0.0, 0.0, 0.0, 0.0).\n *\n * @type {Quaternion}\n * @constant\n */\nQuaternion.ZERO = Object.freeze(new Quaternion(0.0, 0.0, 0.0, 0.0));\n\n/**\n * An immutable Quaternion instance initialized to (0.0, 0.0, 0.0, 1.0).\n *\n * @type {Quaternion}\n * @constant\n */\nQuaternion.IDENTITY = Object.freeze(new Quaternion(0.0, 0.0, 0.0, 1.0));\n\n/**\n * Duplicates this Quaternion instance.\n *\n * @param {Quaternion} [result] The object onto which to store the result.\n * @returns {Quaternion} The modified result parameter or a new Quaternion instance if one was not provided.\n */\nQuaternion.prototype.clone = function (result) {\n return Quaternion.clone(this, result);\n};\n\n/**\n * Compares this and the provided quaternion componentwise and returns\n * true
if they are equal, false
otherwise.\n *\n * @param {Quaternion} [right] The right hand side quaternion.\n * @returns {boolean} true
if left and right are equal, false
otherwise.\n */\nQuaternion.prototype.equals = function (right) {\n return Quaternion.equals(this, right);\n};\n\n/**\n * Compares this and the provided quaternion componentwise and returns\n * true
if they are within the provided epsilon,\n * false
otherwise.\n *\n * @param {Quaternion} [right] The right hand side quaternion.\n * @param {number} [epsilon=0] The epsilon to use for equality testing.\n * @returns {boolean} true
if left and right are within the provided epsilon, false
otherwise.\n */\nQuaternion.prototype.equalsEpsilon = function (right, epsilon) {\n return Quaternion.equalsEpsilon(this, right, epsilon);\n};\n\n/**\n * Returns a string representing this quaternion in the format (x, y, z, w).\n *\n * @returns {string} A string representing this Quaternion.\n */\nQuaternion.prototype.toString = function () {\n return `(${this.x}, ${this.y}, ${this.z}, ${this.w})`;\n};\nexport default Quaternion;\n","import Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Fullscreen from \"./Fullscreen.js\";\n\nlet theNavigator;\nif (typeof navigator !== \"undefined\") {\n theNavigator = navigator;\n} else {\n theNavigator = {};\n}\n\nfunction extractVersion(versionString) {\n const parts = versionString.split(\".\");\n for (let i = 0, len = parts.length; i < len; ++i) {\n parts[i] = parseInt(parts[i], 10);\n }\n return parts;\n}\n\nlet isChromeResult;\nlet chromeVersionResult;\nfunction isChrome() {\n if (!defined(isChromeResult)) {\n isChromeResult = false;\n // Edge contains Chrome in the user agent too\n if (!isEdge()) {\n const fields = / Chrome\\/([\\.0-9]+)/.exec(theNavigator.userAgent);\n if (fields !== null) {\n isChromeResult = true;\n chromeVersionResult = extractVersion(fields[1]);\n }\n }\n }\n\n return isChromeResult;\n}\n\nfunction chromeVersion() {\n return isChrome() && chromeVersionResult;\n}\n\nlet isSafariResult;\nlet safariVersionResult;\nfunction isSafari() {\n if (!defined(isSafariResult)) {\n isSafariResult = false;\n\n // Chrome and Edge contain Safari in the user agent too\n if (\n !isChrome() &&\n !isEdge() &&\n / Safari\\/[\\.0-9]+/.test(theNavigator.userAgent)\n ) {\n const fields = / Version\\/([\\.0-9]+)/.exec(theNavigator.userAgent);\n if (fields !== null) {\n isSafariResult = true;\n safariVersionResult = extractVersion(fields[1]);\n }\n }\n }\n\n return isSafariResult;\n}\n\nfunction safariVersion() {\n return isSafari() && safariVersionResult;\n}\n\nlet isWebkitResult;\nlet webkitVersionResult;\nfunction isWebkit() {\n if (!defined(isWebkitResult)) {\n isWebkitResult = false;\n\n const fields = / AppleWebKit\\/([\\.0-9]+)(\\+?)/.exec(theNavigator.userAgent);\n if (fields !== null) {\n isWebkitResult = true;\n webkitVersionResult = extractVersion(fields[1]);\n webkitVersionResult.isNightly = !!fields[2];\n }\n }\n\n return isWebkitResult;\n}\n\nfunction webkitVersion() {\n return isWebkit() && webkitVersionResult;\n}\n\nlet isInternetExplorerResult;\nlet internetExplorerVersionResult;\nfunction isInternetExplorer() {\n if (!defined(isInternetExplorerResult)) {\n isInternetExplorerResult = false;\n\n let fields;\n if (theNavigator.appName === \"Microsoft Internet Explorer\") {\n fields = /MSIE ([0-9]{1,}[\\.0-9]{0,})/.exec(theNavigator.userAgent);\n if (fields !== null) {\n isInternetExplorerResult = true;\n internetExplorerVersionResult = extractVersion(fields[1]);\n }\n } else if (theNavigator.appName === \"Netscape\") {\n fields = /Trident\\/.*rv:([0-9]{1,}[\\.0-9]{0,})/.exec(\n theNavigator.userAgent,\n );\n if (fields !== null) {\n isInternetExplorerResult = true;\n internetExplorerVersionResult = extractVersion(fields[1]);\n }\n }\n }\n return isInternetExplorerResult;\n}\n\nfunction internetExplorerVersion() {\n return isInternetExplorer() && internetExplorerVersionResult;\n}\n\nlet isEdgeResult;\nlet edgeVersionResult;\nfunction isEdge() {\n if (!defined(isEdgeResult)) {\n isEdgeResult = false;\n const fields = / Edg\\/([\\.0-9]+)/.exec(theNavigator.userAgent);\n if (fields !== null) {\n isEdgeResult = true;\n edgeVersionResult = extractVersion(fields[1]);\n }\n }\n return isEdgeResult;\n}\n\nfunction edgeVersion() {\n return isEdge() && edgeVersionResult;\n}\n\nlet isFirefoxResult;\nlet firefoxVersionResult;\nfunction isFirefox() {\n if (!defined(isFirefoxResult)) {\n isFirefoxResult = false;\n\n const fields = /Firefox\\/([\\.0-9]+)/.exec(theNavigator.userAgent);\n if (fields !== null) {\n isFirefoxResult = true;\n firefoxVersionResult = extractVersion(fields[1]);\n }\n }\n return isFirefoxResult;\n}\n\nlet isWindowsResult;\nfunction isWindows() {\n if (!defined(isWindowsResult)) {\n isWindowsResult = /Windows/i.test(theNavigator.appVersion);\n }\n return isWindowsResult;\n}\n\nlet isIPadOrIOSResult;\nfunction isIPadOrIOS() {\n if (!defined(isIPadOrIOSResult)) {\n isIPadOrIOSResult =\n navigator.platform === \"iPhone\" ||\n navigator.platform === \"iPod\" ||\n navigator.platform === \"iPad\";\n }\n\n return isIPadOrIOSResult;\n}\n\nfunction firefoxVersion() {\n return isFirefox() && firefoxVersionResult;\n}\n\nlet hasPointerEvents;\nfunction supportsPointerEvents() {\n if (!defined(hasPointerEvents)) {\n //While navigator.pointerEnabled is deprecated in the W3C specification\n //we still need to use it if it exists in order to support browsers\n //that rely on it, such as the Windows WebBrowser control which defines\n //PointerEvent but sets navigator.pointerEnabled to false.\n\n //Firefox disabled because of https://github.com/CesiumGS/cesium/issues/6372\n hasPointerEvents =\n !isFirefox() &&\n typeof PointerEvent !== \"undefined\" &&\n (!defined(theNavigator.pointerEnabled) || theNavigator.pointerEnabled);\n }\n return hasPointerEvents;\n}\n\nlet imageRenderingValueResult;\nlet supportsImageRenderingPixelatedResult;\nfunction supportsImageRenderingPixelated() {\n if (!defined(supportsImageRenderingPixelatedResult)) {\n const canvas = document.createElement(\"canvas\");\n canvas.setAttribute(\n \"style\",\n \"image-rendering: -moz-crisp-edges;\" + \"image-rendering: pixelated;\",\n );\n //canvas.style.imageRendering will be undefined, null or an empty string on unsupported browsers.\n const tmp = canvas.style.imageRendering;\n supportsImageRenderingPixelatedResult = defined(tmp) && tmp !== \"\";\n if (supportsImageRenderingPixelatedResult) {\n imageRenderingValueResult = tmp;\n }\n }\n return supportsImageRenderingPixelatedResult;\n}\n\nfunction imageRenderingValue() {\n return supportsImageRenderingPixelated()\n ? imageRenderingValueResult\n : undefined;\n}\n\nfunction supportsWebP() {\n //>>includeStart('debug', pragmas.debug);\n if (!supportsWebP.initialized) {\n throw new DeveloperError(\n \"You must call FeatureDetection.supportsWebP.initialize and wait for the promise to resolve before calling FeatureDetection.supportsWebP\",\n );\n }\n //>>includeEnd('debug');\n return supportsWebP._result;\n}\nsupportsWebP._promise = undefined;\nsupportsWebP._result = undefined;\nsupportsWebP.initialize = function () {\n // From https://developers.google.com/speed/webp/faq#how_can_i_detect_browser_support_for_webp\n if (defined(supportsWebP._promise)) {\n return supportsWebP._promise;\n }\n\n supportsWebP._promise = new Promise((resolve) => {\n const image = new Image();\n image.onload = function () {\n supportsWebP._result = image.width > 0 && image.height > 0;\n resolve(supportsWebP._result);\n };\n\n image.onerror = function () {\n supportsWebP._result = false;\n resolve(supportsWebP._result);\n };\n image.src =\n \"data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA\";\n });\n\n return supportsWebP._promise;\n};\nObject.defineProperties(supportsWebP, {\n initialized: {\n get: function () {\n return defined(supportsWebP._result);\n },\n },\n});\n\nconst typedArrayTypes = [];\nif (typeof ArrayBuffer !== \"undefined\") {\n typedArrayTypes.push(\n Int8Array,\n Uint8Array,\n Int16Array,\n Uint16Array,\n Int32Array,\n Uint32Array,\n Float32Array,\n Float64Array,\n );\n\n if (typeof Uint8ClampedArray !== \"undefined\") {\n typedArrayTypes.push(Uint8ClampedArray);\n }\n\n if (typeof Uint8ClampedArray !== \"undefined\") {\n typedArrayTypes.push(Uint8ClampedArray);\n }\n\n if (typeof BigInt64Array !== \"undefined\") {\n // eslint-disable-next-line no-undef\n typedArrayTypes.push(BigInt64Array);\n }\n\n if (typeof BigUint64Array !== \"undefined\") {\n // eslint-disable-next-line no-undef\n typedArrayTypes.push(BigUint64Array);\n }\n}\n\n/**\n * A set of functions to detect whether the current browser supports\n * various features.\n *\n * @namespace FeatureDetection\n */\nconst FeatureDetection = {\n isChrome: isChrome,\n chromeVersion: chromeVersion,\n isSafari: isSafari,\n safariVersion: safariVersion,\n isWebkit: isWebkit,\n webkitVersion: webkitVersion,\n isInternetExplorer: isInternetExplorer,\n internetExplorerVersion: internetExplorerVersion,\n isEdge: isEdge,\n edgeVersion: edgeVersion,\n isFirefox: isFirefox,\n firefoxVersion: firefoxVersion,\n isWindows: isWindows,\n isIPadOrIOS: isIPadOrIOS,\n hardwareConcurrency: defaultValue(theNavigator.hardwareConcurrency, 3),\n supportsPointerEvents: supportsPointerEvents,\n supportsImageRenderingPixelated: supportsImageRenderingPixelated,\n supportsWebP: supportsWebP,\n imageRenderingValue: imageRenderingValue,\n typedArrayTypes: typedArrayTypes,\n};\n\n/**\n * Detects whether the current browser supports Basis Universal textures and the web assembly modules needed to transcode them.\n *\n * @param {Scene} scene\n * @returns {boolean} true if the browser supports web assembly modules and the scene supports Basis Universal textures, false if not.\n */\nFeatureDetection.supportsBasis = function (scene) {\n return FeatureDetection.supportsWebAssembly() && scene.context.supportsBasis;\n};\n\n/**\n * Detects whether the current browser supports the full screen standard.\n *\n * @returns {boolean} true if the browser supports the full screen standard, false if not.\n *\n * @see Fullscreen\n * @see {@link http://dvcs.w3.org/hg/fullscreen/raw-file/tip/Overview.html|W3C Fullscreen Living Specification}\n */\nFeatureDetection.supportsFullscreen = function () {\n return Fullscreen.supportsFullscreen();\n};\n\n/**\n * Detects whether the current browser supports typed arrays.\n *\n * @returns {boolean} true if the browser supports typed arrays, false if not.\n *\n * @see {@link https://tc39.es/ecma262/#sec-typedarray-objects|Typed Array Specification}\n */\nFeatureDetection.supportsTypedArrays = function () {\n return typeof ArrayBuffer !== \"undefined\";\n};\n\n/**\n * Detects whether the current browser supports BigInt64Array typed arrays.\n *\n * @returns {boolean} true if the browser supports BigInt64Array typed arrays, false if not.\n *\n * @see {@link https://tc39.es/ecma262/#sec-typedarray-objects|Typed Array Specification}\n */\nFeatureDetection.supportsBigInt64Array = function () {\n return typeof BigInt64Array !== \"undefined\";\n};\n\n/**\n * Detects whether the current browser supports BigUint64Array typed arrays.\n *\n * @returns {boolean} true if the browser supports BigUint64Array typed arrays, false if not.\n *\n * @see {@link https://tc39.es/ecma262/#sec-typedarray-objects|Typed Array Specification}\n */\nFeatureDetection.supportsBigUint64Array = function () {\n return typeof BigUint64Array !== \"undefined\";\n};\n\n/**\n * Detects whether the current browser supports BigInt.\n *\n * @returns {boolean} true if the browser supports BigInt, false if not.\n *\n * @see {@link https://tc39.es/ecma262/#sec-bigint-objects|BigInt Specification}\n */\nFeatureDetection.supportsBigInt = function () {\n return typeof BigInt !== \"undefined\";\n};\n\n/**\n * Detects whether the current browser supports Web Workers.\n *\n * @returns {boolean} true if the browsers supports Web Workers, false if not.\n *\n * @see {@link http://www.w3.org/TR/workers/}\n */\nFeatureDetection.supportsWebWorkers = function () {\n return typeof Worker !== \"undefined\";\n};\n\n/**\n * Detects whether the current browser supports Web Assembly.\n *\n * @returns {boolean} true if the browsers supports Web Assembly, false if not.\n *\n * @see {@link https://developer.mozilla.org/en-US/docs/WebAssembly}\n */\nFeatureDetection.supportsWebAssembly = function () {\n return typeof WebAssembly !== \"undefined\";\n};\n\n/**\n * Detects whether the current browser supports a WebGL2 rendering context for the specified scene.\n *\n * @param {Scene} scene the Cesium scene specifying the rendering context\n * @returns {boolean} true if the browser supports a WebGL2 rendering context, false if not.\n *\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext|WebGL2RenderingContext}\n */\nFeatureDetection.supportsWebgl2 = function (scene) {\n //>>includeStart('debug', pragmas.debug);\n Check.defined(\"scene\", scene);\n //>>includeEnd('debug');\n\n return scene.context.webgl2;\n};\n\n/**\n * Detects whether the current browser supports ECMAScript modules in web workers.\n * @returns {boolean} true if the browser supports ECMAScript modules in web workers.\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Worker|Worker}\n */\nFeatureDetection.supportsEsmWebWorkers = function () {\n return !isFirefox() || parseInt(firefoxVersionResult) >= 114;\n};\n\nexport default FeatureDetection;\n","import defined from \"./defined.js\";\n\nlet _supportsFullscreen;\nconst _names = {\n requestFullscreen: undefined,\n exitFullscreen: undefined,\n fullscreenEnabled: undefined,\n fullscreenElement: undefined,\n fullscreenchange: undefined,\n fullscreenerror: undefined,\n};\n\n/**\n * Browser-independent functions for working with the standard fullscreen API.\n *\n * @namespace Fullscreen\n *\n * @see {@link http://dvcs.w3.org/hg/fullscreen/raw-file/tip/Overview.html|W3C Fullscreen Living Specification}\n */\nconst Fullscreen = {};\n\nObject.defineProperties(Fullscreen, {\n /**\n * The element that is currently fullscreen, if any. To simply check if the\n * browser is in fullscreen mode or not, use {@link Fullscreen#fullscreen}.\n * @memberof Fullscreen\n * @type {object}\n * @readonly\n */\n element: {\n get: function () {\n if (!Fullscreen.supportsFullscreen()) {\n return undefined;\n }\n\n return document[_names.fullscreenElement];\n },\n },\n\n /**\n * The name of the event on the document that is fired when fullscreen is\n * entered or exited. This event name is intended for use with addEventListener.\n * In your event handler, to determine if the browser is in fullscreen mode or not,\n * use {@link Fullscreen#fullscreen}.\n * @memberof Fullscreen\n * @type {string}\n * @readonly\n */\n changeEventName: {\n get: function () {\n if (!Fullscreen.supportsFullscreen()) {\n return undefined;\n }\n\n return _names.fullscreenchange;\n },\n },\n\n /**\n * The name of the event that is fired when a fullscreen error\n * occurs. This event name is intended for use with addEventListener.\n * @memberof Fullscreen\n * @type {string}\n * @readonly\n */\n errorEventName: {\n get: function () {\n if (!Fullscreen.supportsFullscreen()) {\n return undefined;\n }\n\n return _names.fullscreenerror;\n },\n },\n\n /**\n * Determine whether the browser will allow an element to be made fullscreen, or not.\n * For example, by default, iframes cannot go fullscreen unless the containing page\n * adds an \"allowfullscreen\" attribute (or prefixed equivalent).\n * @memberof Fullscreen\n * @type {boolean}\n * @readonly\n */\n enabled: {\n get: function () {\n if (!Fullscreen.supportsFullscreen()) {\n return undefined;\n }\n\n return document[_names.fullscreenEnabled];\n },\n },\n\n /**\n * Determines if the browser is currently in fullscreen mode.\n * @memberof Fullscreen\n * @type {boolean}\n * @readonly\n */\n fullscreen: {\n get: function () {\n if (!Fullscreen.supportsFullscreen()) {\n return undefined;\n }\n\n return Fullscreen.element !== null;\n },\n },\n});\n\n/**\n * Detects whether the browser supports the standard fullscreen API.\n *\n * @returns {boolean} true
if the browser supports the standard fullscreen API,\n * false
otherwise.\n */\nFullscreen.supportsFullscreen = function () {\n if (defined(_supportsFullscreen)) {\n return _supportsFullscreen;\n }\n\n _supportsFullscreen = false;\n\n const body = document.body;\n if (typeof body.requestFullscreen === \"function\") {\n // go with the unprefixed, standard set of names\n _names.requestFullscreen = \"requestFullscreen\";\n _names.exitFullscreen = \"exitFullscreen\";\n _names.fullscreenEnabled = \"fullscreenEnabled\";\n _names.fullscreenElement = \"fullscreenElement\";\n _names.fullscreenchange = \"fullscreenchange\";\n _names.fullscreenerror = \"fullscreenerror\";\n _supportsFullscreen = true;\n return _supportsFullscreen;\n }\n\n //check for the correct combination of prefix plus the various names that browsers use\n const prefixes = [\"webkit\", \"moz\", \"o\", \"ms\", \"khtml\"];\n let name;\n for (let i = 0, len = prefixes.length; i < len; ++i) {\n const prefix = prefixes[i];\n\n // casing of Fullscreen differs across browsers\n name = `${prefix}RequestFullscreen`;\n if (typeof body[name] === \"function\") {\n _names.requestFullscreen = name;\n _supportsFullscreen = true;\n } else {\n name = `${prefix}RequestFullScreen`;\n if (typeof body[name] === \"function\") {\n _names.requestFullscreen = name;\n _supportsFullscreen = true;\n }\n }\n\n // disagreement about whether it's \"exit\" as per spec, or \"cancel\"\n name = `${prefix}ExitFullscreen`;\n if (typeof document[name] === \"function\") {\n _names.exitFullscreen = name;\n } else {\n name = `${prefix}CancelFullScreen`;\n if (typeof document[name] === \"function\") {\n _names.exitFullscreen = name;\n }\n }\n\n // casing of Fullscreen differs across browsers\n name = `${prefix}FullscreenEnabled`;\n if (document[name] !== undefined) {\n _names.fullscreenEnabled = name;\n } else {\n name = `${prefix}FullScreenEnabled`;\n if (document[name] !== undefined) {\n _names.fullscreenEnabled = name;\n }\n }\n\n // casing of Fullscreen differs across browsers\n name = `${prefix}FullscreenElement`;\n if (document[name] !== undefined) {\n _names.fullscreenElement = name;\n } else {\n name = `${prefix}FullScreenElement`;\n if (document[name] !== undefined) {\n _names.fullscreenElement = name;\n }\n }\n\n // thankfully, event names are all lowercase per spec\n name = `${prefix}fullscreenchange`;\n // event names do not have 'on' in the front, but the property on the document does\n if (document[`on${name}`] !== undefined) {\n //except on IE\n if (prefix === \"ms\") {\n name = \"MSFullscreenChange\";\n }\n _names.fullscreenchange = name;\n }\n\n name = `${prefix}fullscreenerror`;\n if (document[`on${name}`] !== undefined) {\n //except on IE\n if (prefix === \"ms\") {\n name = \"MSFullscreenError\";\n }\n _names.fullscreenerror = name;\n }\n }\n\n return _supportsFullscreen;\n};\n\n/**\n * Asynchronously requests the browser to enter fullscreen mode on the given element.\n * If fullscreen mode is not supported by the browser, does nothing.\n *\n * @param {object} element The HTML element which will be placed into fullscreen mode.\n * @param {object} [vrDevice] The HMDVRDevice device.\n *\n * @example\n * // Put the entire page into fullscreen.\n * Cesium.Fullscreen.requestFullscreen(document.body)\n *\n * // Place only the Cesium canvas into fullscreen.\n * Cesium.Fullscreen.requestFullscreen(scene.canvas)\n */\nFullscreen.requestFullscreen = function (element, vrDevice) {\n if (!Fullscreen.supportsFullscreen()) {\n return;\n }\n\n element[_names.requestFullscreen]({ vrDisplay: vrDevice });\n};\n\n/**\n * Asynchronously exits fullscreen mode. If the browser is not currently\n * in fullscreen, or if fullscreen mode is not supported by the browser, does nothing.\n */\nFullscreen.exitFullscreen = function () {\n if (!Fullscreen.supportsFullscreen()) {\n return;\n }\n\n document[_names.exitFullscreen]();\n};\n\n//For unit tests\nFullscreen._names = _names;\nexport default Fullscreen;\n"],"names":["$6fb706f4a1c1ff12$var$a","$b1dcbeb8d31d71ff$var$supportsImageBitmapOptionsPromise","$b73be531cd978718$var$a","$b73be531cd978718$var$baseResource","$b73be531cd978718$var$implementation","$19a47bf34378ad7c$var$_supportsFullscreen","$da149e13e9eaa5f6$var$theNavigator","$da149e13e9eaa5f6$var$isChromeResult","$da149e13e9eaa5f6$var$chromeVersionResult","$da149e13e9eaa5f6$var$isSafariResult","$da149e13e9eaa5f6$var$safariVersionResult","$da149e13e9eaa5f6$var$isWebkitResult","$da149e13e9eaa5f6$var$webkitVersionResult","$da149e13e9eaa5f6$var$isInternetExplorerResult","$da149e13e9eaa5f6$var$internetExplorerVersionResult","$da149e13e9eaa5f6$var$isEdgeResult","$da149e13e9eaa5f6$var$edgeVersionResult","$da149e13e9eaa5f6$var$isFirefoxResult","$da149e13e9eaa5f6$var$firefoxVersionResult","$da149e13e9eaa5f6$var$isWindowsResult","$da149e13e9eaa5f6$var$isIPadOrIOSResult","$da149e13e9eaa5f6$var$hasPointerEvents","$da149e13e9eaa5f6$var$imageRenderingValueResult","$da149e13e9eaa5f6$var$supportsImageRenderingPixelatedResult","t","root","factory","$parcel$global","globalThis","$parcel$interopDefault","a","__esModule","default","$parcel$modules","$parcel$inits","parcelRequire","id","exports","init","module","call","err","Error","code","register","parcelRegister","freeExports","nodeType","freeModule","freeGlobal","global","window","self","punycode","key","regexPunycode","regexNonASCII","regexSeparators","errors","floor","Math","stringFromCharCode","String","fromCharCode","error","type","RangeError","map","array","fn","length","result","mapDomain","string","parts","split","replace","join","ucs2decode","value","extra","output","counter","charCodeAt","push","ucs2encode","digitToBasic","digit","flag","adapt","delta","numPoints","firstTime","k","baseMinusTMin","base","decode","input","codePoint","out","basic","j","index","oldi","w","baseMinusT","inputLength","i","n","bias","lastIndexOf","maxInt","splice","encode","handledCPCount","basicLength","m","q","currentValue","handledCPCountPlusOne","qMinusT","test","slice","toLowerCase","define","amd","hasOwnProperty","_IPv6","IPv6","best","address","pos","_segments","segments","_address","total","shift","pop","indexOf","_best","_current","current","inzeroes","noConflict","_SecondLevelDomains","SecondLevelDomains","SLD","list","has","domain","tldOffset","sldOffset","sldList","is","get","$800sp","$jJTNo","$3baabda811939da5$export$befdefbdce210f91","constructor","_$AU","_$AM","_$AT","e","_$AS","update","render","$74d80410d825d70d$var$ee","$74d80410d825d70d$var$ie","$74d80410d825d70d$export$1e5b4ce2fa884e6a","name","strings","Object","keys","reduce","r","s","includes","style","element","ft","Set","delete","removeProperty","add","endsWith","setProperty","noChange","_$litDirective$","values","$kWQjc","$bXwZF","$3pzcG","$8w8ZH","$jQJji","$AXvpI","$1vHsR","$667f84b0348f3801$var$scaleToGeodeticSurfaceIntersection","$667f84b0348f3801$var$scaleToGeodeticSurfaceGradient","$667f84b0348f3801$export$2e2bcd8739ae039","cartesian","oneOverRadii","oneOverRadiiSquared","centerToleranceSquared","func","xMultiplier","yMultiplier","zMultiplier","xMultiplier2","yMultiplier2","zMultiplier2","xMultiplier3","yMultiplier3","zMultiplier3","positionX","x","positionY","y","positionZ","z","oneOverRadiiX","oneOverRadiiY","oneOverRadiiZ","x2","y2","z2","squaredNorm","ratio","sqrt","intersection","multiplyByScalar","isFinite","clone","undefined","oneOverRadiiSquaredX","oneOverRadiiSquaredY","oneOverRadiiSquaredZ","gradient","lambda","magnitude","correction","abs","EPSILON12","$69f9194a3ef67d4b$var$Cartographic","longitude","latitude","height","fromRadians","typeOf","number","fromDegrees","toRadians","$69f9194a3ef67d4b$var$cartesianToCartographicN","$69f9194a3ef67d4b$var$cartesianToCartographicP","$69f9194a3ef67d4b$var$cartesianToCartographicH","_ellipsoidOneOverRadii","_ellipsoidOneOverRadiiSquared","_ellipsoidCenterToleranceSquared","EPSILON1","fromCartesian","ellipsoid","p","_centerToleranceSquared","multiplyComponents","normalize","h","subtract","atan2","asin","sign","dot","toCartesian","cartographic","defined","equals","left","right","equalsEpsilon","epsilon","ZERO","freeze","prototype","toString","$5237444a2d786ec9$var$initialize","greaterThanOrEquals","_radii","_radiiSquared","_radiiToTheFourth","_oneOverRadii","_oneOverRadiiSquared","_minimumRadius","min","_maximumRadius","max","_squaredXOverSquaredZ","$5237444a2d786ec9$var$Ellipsoid","defineProperties","radii","radiiSquared","radiiToTheFourth","minimumRadius","maximumRadius","fromCartesian3","WGS84","UNIT_SPHERE","MOON","LUNAR_RADIUS","_default","set","object","_ellipsoidRadiiSquared","packedLength","pack","startingIndex","unpack","geocentricSurfaceNormal","geodeticSurfaceNormalCartographic","cosLatitude","cos","sin","geodeticSurfaceNormal","isNaN","EPSILON14","$5237444a2d786ec9$var$cartographicToCartesianNormal","$5237444a2d786ec9$var$cartographicToCartesianK","cartographicToCartesian","gamma","divideByScalar","cartographicArrayToCartesianArray","cartographics","Array","$5237444a2d786ec9$var$cartesianToCartographicN","$5237444a2d786ec9$var$cartesianToCartographicP","$5237444a2d786ec9$var$cartesianToCartographicH","cartesianToCartographic","scaleToGeodeticSurface","cartesianArrayToCartographicArray","cartesians","scaleToGeocentricSurface","beta","transformPositionToScaledSpace","position","transformPositionFromScaledSpace","getSurfaceNormalIntersectionWithZAxis","buffer","EPSILON15","greaterThan","squaredXOverSquaredZ","$5237444a2d786ec9$var$scratchEndpoint","getLocalCurvature","surfacePosition","primeVerticalEndpoint","primeVerticalRadius","distance","radiusRatio","fromElements","$5237444a2d786ec9$var$abscissas","$5237444a2d786ec9$var$weights","$5237444a2d786ec9$var$gaussLegendreQuadrature","b","xMean","xRange","sum","dx","surfaceArea","rectangle","minLongitude","west","maxLongitude","east","minLatitude","south","maxLatitude","north","TWO_PI","a2","b2","c2","a2b2","lat","sinPhi","cosPhi","lon","cosTheta","sinTheta","$dba8420c01d8a224$var$Cartesian4","fromColor","color","red","green","blue","alpha","packArray","resultLength","isArray","unpackArray","fromArray","maximumComponent","minimumComponent","minimumByComponent","first","second","maximumByComponent","clamp","magnitudeSquared","$dba8420c01d8a224$var$distanceScratch","distanceSquared","divideComponents","scalar","negate","$dba8420c01d8a224$var$lerpScratch","lerp","start","end","$dba8420c01d8a224$var$mostOrthogonalAxisScratch","mostOrthogonalAxis","f","UNIT_X","UNIT_W","UNIT_Z","UNIT_Y","equalsArray","offset","relativeEpsilon","absoluteEpsilon","ONE","$dba8420c01d8a224$var$scratchF32Array","Float32Array","$dba8420c01d8a224$var$scratchU8Array","Uint8Array","$dba8420c01d8a224$var$littleEndian","$dba8420c01d8a224$var$testU8","$dba8420c01d8a224$var$testU32","Uint32Array","packFloat","unpackFloat","packedFloat","$490279d1ff27cf6c$var$Matrix3","column0Row0","column1Row0","column2Row0","column0Row1","column1Row1","column2Row1","column0Row2","column1Row2","column2Row2","matrix","fromColumnMajorArray","fromRowMajorArray","fromQuaternion","quaternion","xy","xz","xw","yz","yw","zw","w2","m00","m01","m02","m10","m11","m12","m20","m21","m22","fromHeadingPitchRoll","headingPitchRoll","pitch","cosPsi","heading","roll","sinPsi","fromScale","scale","fromUniformScale","fromCrossProduct","vector","fromRotationX","angle","cosAngle","sinAngle","fromRotationY","fromRotationZ","toArray","getElementIndex","column","row","lessThanOrEquals","getColumn","startIndex","setColumn","getRow","setRow","$490279d1ff27cf6c$var$scaleScratch1","setScale","existingScale","getScale","scaleRatioX","scaleRatioY","scaleRatioZ","$490279d1ff27cf6c$var$scaleScratch2","setUniformScale","$490279d1ff27cf6c$var$scratchColumn","$490279d1ff27cf6c$var$scaleScratch3","getMaximumScale","$490279d1ff27cf6c$var$scaleScratch4","setRotation","rotation","$490279d1ff27cf6c$var$scaleScratch5","getRotation","multiply","multiplyByVector","vX","vY","vZ","multiplyByScale","multiplyByUniformScale","transpose","$490279d1ff27cf6c$var$rowVal","$490279d1ff27cf6c$var$colVal","$490279d1ff27cf6c$var$jMatrix","$490279d1ff27cf6c$var$jMatrixTranspose","computeEigenDecomposition","tolerance","EPSILON20","count","sweep","unitaryMatrix","unitary","IDENTITY","diagMatrix","diagonal","$490279d1ff27cf6c$var$computeFrobeniusNorm","norm","temp","$490279d1ff27cf6c$var$offDiagonalFrobeniusNorm","$490279d1ff27cf6c$var$shurDecomposition","maxDiagonal","rotAxis","c","tau","qq","determinant","m31","m32","m13","m23","m33","inverse","$490279d1ff27cf6c$var$scratchTransposeMatrix","inverseTranspose","COLUMN0ROW0","COLUMN0ROW1","COLUMN0ROW2","COLUMN1ROW0","COLUMN1ROW1","COLUMN1ROW2","COLUMN2ROW0","COLUMN2ROW1","COLUMN2ROW2","$60086b06bf5db23f$var$RuntimeError","message","stack","$7ec6ab76c28fee32$var$Matrix4","column3Row0","column3Row1","column3Row2","column0Row3","column1Row3","column2Row3","column3Row3","create","str","fromRotationTranslation","translation","fromTranslationQuaternionRotationScale","scaleX","scaleY","scaleZ","fromTranslationRotationScale","translationRotationScale","fromTranslation","fromRotation","$7ec6ab76c28fee32$var$fromCameraF","$7ec6ab76c28fee32$var$fromCameraR","$7ec6ab76c28fee32$var$fromCameraU","fromCamera","camera","direction","up","cross","sX","sY","sZ","fX","fY","fZ","uX","uY","uZ","t0","t1","t2","computePerspectiveFieldOfView","fovY","aspectRatio","near","far","lessThan","PI","tan","computeOrthographicOffCenter","bottom","top","tx","ty","tz","computePerspectiveOffCenter","computeInfinitePerspectiveOffCenter","computeViewportTransformation","viewport","nearDepthRange","farDepthRange","EMPTY_OBJECT","width","halfWidth","halfHeight","halfDepth","computeView","setTranslation","$7ec6ab76c28fee32$var$scaleScratch1","$7ec6ab76c28fee32$var$scaleScratch2","$7ec6ab76c28fee32$var$scratchColumn","$7ec6ab76c28fee32$var$scaleScratch3","$7ec6ab76c28fee32$var$scaleScratch4","$7ec6ab76c28fee32$var$scaleScratch5","left0","left1","left2","left3","left4","left5","left6","left7","left8","left9","left10","left11","left12","left13","left14","left15","right0","right1","right2","right3","right4","right5","right6","right7","right8","right9","right10","right11","right12","right13","right14","right15","multiplyTransformation","multiplyByMatrix3","multiplyByTranslation","vW","multiplyByPointAsVector","multiplyByPoint","matrix1","matrix2","matrix3","matrix6","matrix7","matrix11","getTranslation","getMatrix3","$7ec6ab76c28fee32$var$scratchInverseRotation","$7ec6ab76c28fee32$var$scratchMatrix3Zero","$7ec6ab76c28fee32$var$scratchBottomRow","$7ec6ab76c28fee32$var$scratchExpectedBottomRow","src0","src1","src2","src3","src4","src5","src6","src7","src8","src9","src10","src11","src12","src13","src14","src15","tmp0","tmp1","tmp2","tmp3","tmp4","tmp5","tmp6","tmp7","tmp8","tmp9","tmp10","tmp11","dst0","dst1","dst2","dst3","dst4","dst5","dst6","dst7","dst8","dst9","dst10","dst11","dst12","dst13","dst14","dst15","det","EPSILON21","EPSILON7","inverseTransformation","matrix0","matrix4","matrix5","matrix8","matrix9","matrix10","$7ec6ab76c28fee32$var$scratchTransposeMatrix","COLUMN0ROW3","COLUMN1ROW3","COLUMN2ROW3","COLUMN3ROW0","COLUMN3ROW1","COLUMN3ROW2","COLUMN3ROW3","$9btZb","$52c19b09ece4c63f$export$2e2bcd8739ae039","itemToFind","comparator","comparison","low","high","$733293b70aae4cad$export$2e2bcd8739ae039","xPoleWander","yPoleWander","xPoleOffset","yPoleOffset","ut1MinusUtc","$86dc94fb6bcfc713$export$2e2bcd8739ae039","year","$33ab1ce7e2935ae4$var$daysInYear","$33ab1ce7e2935ae4$export$2e2bcd8739ae039","month","day","hour","minute","millisecond","isLeapSecond","bool","maximumSecond","validateDate","daysInMonth","$97869fccaa735547$export$2e2bcd8739ae039","date","julianDate","$e3d50c782acbaff1$export$2e2bcd8739ae039","SECONDS_PER_MILLISECOND","SECONDS_PER_MINUTE","MINUTES_PER_HOUR","HOURS_PER_DAY","SECONDS_PER_HOUR","MINUTES_PER_DAY","SECONDS_PER_DAY","DAYS_PER_JULIAN_CENTURY","PICOSECOND","MODIFIED_JULIAN_DATE_DIFFERENCE","$134462e760c5c083$export$2e2bcd8739ae039","UTC","TAI","$73b9691e04761700$var$gregorianDateScratch","$73b9691e04761700$var$daysInMonth","$73b9691e04761700$var$compareLeapSecondDates","leapSecond","dateToFind","$73b9691e04761700$var$JulianDate","compare","$73b9691e04761700$var$binarySearchScratchLeapSecond","$73b9691e04761700$var$convertUtcToTai","leapSeconds","difference","secondsDifference","addSeconds","$73b9691e04761700$var$convertTaiToUtc","$73b9691e04761700$var$setComponents","wholeDays","secondsOfDay","extraDays","dayNumber","$73b9691e04761700$var$computeJulianDateComponents","$73b9691e04761700$var$matchCalendarYear","$73b9691e04761700$var$matchCalendarMonth","$73b9691e04761700$var$matchOrdinalDate","$73b9691e04761700$var$matchWeekDate","$73b9691e04761700$var$matchCalendarDate","$73b9691e04761700$var$utcOffset","$73b9691e04761700$var$matchHours","source","$73b9691e04761700$var$matchHoursMinutes","$73b9691e04761700$var$matchHoursMinutesSeconds","$73b9691e04761700$var$iso8601ErrorMessage","julianDayNumber","timeStandard","fromGregorianDate","components","fromDate","Date","getTime","getUTCFullYear","getUTCMonth","getUTCDate","getUTCHours","getUTCMinutes","getUTCSeconds","getUTCMilliseconds","fromIso8601","iso8601String","tmp","inLeapYear","dashCount","offsetIndex","tokens","time","match","dayOfYear","weekNumber","dayOfWeek","january4","getUTCDay","setUTCDate","offsetHours","offsetMinutes","getTimezoneOffset","now","$73b9691e04761700$var$toGregorianDateScratch","toGregorianDate","thisUtc","L","N","I","J","remainingSeconds","toDate","gDate","toIso8601","precision","millisecondStr","toFixed","padStart","julianDayNumberDifference","totalDays","dayDifference","daysDifference","computeTaiMinusUtc","seconds","addMinutes","minutes","newSecondsOfDay","addHours","hours","addDays","days","$f3b7c43a7f0c8e85$exports","_part","_URI","URI","url","_urlSupplied","arguments","_baseSupplied","TypeError","location","href","absoluteTo","version","hasOwn","escapeRegEx","getType","obj","filterArrayValues","data","lookup","arrayContains","_type","arraysEqual","one","two","sort","l","trimSlashes","text","escapeForDumbFirefox36","escape","strictEncodeURIComponent","encodeURIComponent","_parts","protocol","username","password","hostname","urn","port","path","query","fragment","preventInvalidHostname","duplicateQueryParameters","escapeQuerySpace","protocol_expression","idn_expression","punycode_expression","ip4_expression","ip6_expression","find_uri_expression","findUri","trim","parens","leading_whitespace_expression","ascii_tab_whitespace","defaultPorts","http","https","ftp","gopher","ws","wss","hostProtocols","invalid_hostname_characters","domAttributes","getDomAttribute","node","nodeName","decodeURIComponent","iso8859","unescape","unicode","characters","pathname","expression","reserved","urnpath","encodeQuery","escaped","decodeQuery","generateAccessor","_group","generateSegmentedPathFunction","_sep","_codingFuncName","_innerCodingFuncName","actualCodingFunc","generateSimpleAccessor","v","build","generatePrefixAccessor","_key","charAt","substring","decodePath","decodeUrnPath","recodePath","recodeUrnPath","encodeReserved","parse","parseAuthority","parseHost","bracketPos","firstColon","firstSlash","nextColon","ensureValidHostname","ensureValidPort","parseUserinfo","_string","parseQuery","items","splits","requireAbsolutePath","buildAuthority","buildHost","buildUserinfo","buildQuery","unique","buildQueryParameter","addQuery","concat","setQuery","removeQuery","hasQuery","withinArray","Boolean","op","joinPaths","nonEmptySegments","segment","uri","commonPath","withinString","callback","options","_start","_end","_trim","_parens","_attributeOpen","lastIndex","exec","ignoreHtml","attributeOpen","search","parensEnd","parensMatch","ignore","hasHostname","rejectEmptyHostname","toASCII","Number","isInteger","removeAll","unconflicted","URITemplate","deferBuild","_deferred_build","valueOf","hash","res","_object","attribute","src","what","ip","ip4","ip6","sld","idn","relative","_protocol","_port","_hostname","scheme","origin","authority","host","userinfo","resource","subdomain","RegExp","tld","ReferenceError","directory","filename","decodePathSegment","mutatedDirectory","normalizePath","suffix","separator","absolute","unshift","segmentCoded","setSearch","addSearch","removeSearch","hasSearch","normalizeProtocol","normalizeQuery","normalizeFragment","normalizeHostname","normalizePort","_was_relative","_parent","_pos","_path","_leadingParents","normalizePathname","normalizeSearch","normalizeHash","d","readable","toUnicode","qp","kv","basedir","resolved","properties","relativeTo","relativeParts","baseParts","common","relativePath","basePath","parents","one_query","two_query","one_map","two_map","checked","$3f52ff37d0636f55$export$2e2bcd8739ae039","$3f52ff37d0636f55$var$clone","deep","propertyName","$8e522a73a8dfbfe2$export$2e2bcd8739ae039","$8e522a73a8dfbfe2$var$combine","object1","object2","property","object1Value","object2Value","object1Defined","object2Defined","$6e11a2ab1ac0872e$export$2e2bcd8739ae039","resolve","reject","promise","Promise","rej","$5d7f3681ccbe43e2$var$getAbsoluteUri","documentObject","document","_implementation","baseURI","relativeUri","$d4cdc3514a25210c$export$2e2bcd8739ae039","includeQuery","$dce14f3284a3bc25$export$2e2bcd8739ae039","uriObject","substr","$5db98adec2cfcc7b$var$context2DsByWidthAndHeight","$5db98adec2cfcc7b$export$2e2bcd8739ae039","image","context2DsByHeight","context2d","canvas","createElement","getContext","willReadFrequently","globalCompositeOperation","drawImage","getImageData","$9f0272ac2370f543$var$blobUriRegex","$9f0272ac2370f543$export$2e2bcd8739ae039","$6fb706f4a1c1ff12$export$2e2bcd8739ae039","$9cb2c183cad552bd$var$dataUriRegex","$9cb2c183cad552bd$export$2e2bcd8739ae039","$e3fa9c82e19e3667$export$2e2bcd8739ae039","script","async","crossOriginIsolated","setAttribute","head","getElementsByTagName","onload","removeChild","onerror","appendChild","$cdf3d7de0c82329e$export$2e2bcd8739ae039","propName","part","len","$cec685f2ea286a8a$export$2e2bcd8739ae039","queryString","subparts","resultValue","$3f5372c4ce85d94e$export$2e2bcd8739ae039","UNISSUED","ISSUED","ACTIVE","RECEIVED","CANCELLED","FAILED","$a60081784b299462$export$2e2bcd8739ae039","TERRAIN","IMAGERY","TILES3D","OTHER","$b1445a5361079efc$var$Request","throttleByServer","throttle","requestFunction","cancelFunction","priorityFunction","priority","serverKey","state","deferred","cancelled","cancel","$caa58768bf1ed120$export$2e2bcd8739ae039","headerString","headers","headerPairs","headerPair","val","$91769fedd238ef04$var$RequestErrorEvent","statusCode","response","responseHeaders","$280a3f96dcc2704b$var$Event","_listeners","_scopes","_toRemove","_insideRaiseEvent","$280a3f96dcc2704b$var$compareNumber","numberOfListeners","addEventListener","listener","scope","event","removeEventListener","listeners","scopes","raiseEvent","apply","toRemove","$3fa9322de64db78e$var$Heap","_comparator","_array","_length","_maximumLength","$3fa9322de64db78e$var$swap","internalArray","maximumLength","originalLength","reserve","heapify","candidate","inserting","resort","ceil","insert","removedElement","parent","$22996820477a6820$var$statistics","numberOfAttemptedRequests","numberOfActiveRequests","numberOfCancelledRequests","numberOfCancelledActiveRequests","numberOfFailedRequests","numberOfActiveRequestsEver","lastNumberOfActiveRequests","$22996820477a6820$var$priorityHeapLength","$22996820477a6820$var$requestHeap","$22996820477a6820$var$activeRequests","$22996820477a6820$var$numberOfActiveRequestsByServer","$22996820477a6820$var$pageUri","$22996820477a6820$var$requestCompletedEvent","$22996820477a6820$var$RequestScheduler","$22996820477a6820$var$updatePriority","request","$22996820477a6820$var$issueRequest","$22996820477a6820$var$startRequest","then","results","catch","$22996820477a6820$var$cancelRequest","active","maximumRequests","maximumRequestsPerServer","requestsByServer","throttleRequests","debugShowStatistics","requestCompletedEvent","statistics","priorityHeapLength","serverHasOpenSlots","desiredRequests","maxRequests","heapHasOpenSlots","removeCount","activeLength","issuedRequests","issuedLength","openSlots","filledSlots","console","log","getServerKey","removedRequest","clearForSpecs","numberOfActiveRequestsByServer","requestHeap","$501f833019c34c9b$var$TrustedServers","$501f833019c34c9b$var$_servers","remove","contains","$501f833019c34c9b$var$getAuthority","clear","$b1dcbeb8d31d71ff$var$xhrBlobSupported","xhr","XMLHttpRequest","open","responseType","$b1dcbeb8d31d71ff$var$Resource","_url","_templateValues","$b1dcbeb8d31d71ff$var$defaultClone","templateValues","_queryParameters","queryParameters","proxy","retryCallback","retryAttempts","_retryCount","parseUrl","_credits","credits","defaultValue","$b1dcbeb8d31d71ff$var$combineQueryParameters","q1","q2","preserveQueryParameters","param","q2Value","$b1dcbeb8d31d71ff$var$fetchImage","flipY","skipColorSpaceConversion","preferImageBitmap","crossOrigin","isDataUri","isBlobUri","isCrossOriginUrl","_Implementations","createImage","retryOnError","retry","$b1dcbeb8d31d71ff$var$checkAndResetRequest","createIfNeeded","getDerivedResource","supportsImageBitmapOptions","createImageBitmap","fetchBlob","blob","all","imageOrientation","premultiplyAlpha","colorSpaceConversion","imageBitmaps","colorWithOptions","colorWithDefaults","isBlobSupported","getUrlComponent","extension","hasHeaders","merge","preserveQuery","baseUrl","$b1dcbeb8d31d71ff$var$stringifyQuery","queryObject","replacement","getURL","setQueryParameters","params","useAsDefault","appendQueryParameters","setTemplateValues","template","that","getBaseUri","appendForwardSlash","fetchArrayBuffer","fetch","fetchImage","useImageBitmap","generatedBlobResource","generatedBlob","preferBlob","blobPromise","supportsImageBitmap","createImageBitmapFromBlob","URL","createObjectURL","revokeObjectURL","fetchText","fetchJson","Accept","JSON","fetchXML","overrideMimeType","fetchJsonp","callbackParameterName","functionName","nextRandomNumber","$b1dcbeb8d31d71ff$var$fetchJsonp","callbackQuery","loadAndExecuteScript","_makeRequest","method","loadWithXhr","abort","$b1dcbeb8d31d71ff$var$dataUriRegex","$b1dcbeb8d31d71ff$var$decodeDataUriText","isBase64","atob","$b1dcbeb8d31d71ff$var$decodeDataUriArrayBuffer","byteString","ArrayBuffer","view","post","put","patch","loadImageElement","Image","naturalWidth","naturalHeight","xhrDeferred","$b1dcbeb8d31d71ff$var$noXMLHttpRequest","$c1eef27c4238262a$var$EarthOrientationParameters","_dates","_samples","_dateColumn","_xPoleWanderRadiansColumn","_yPoleWanderRadiansColumn","_ut1MinusUtcSecondsColumn","_xCelestialPoleOffsetRadiansColumn","_yCelestialPoleOffsetRadiansColumn","_taiMinusUtcSecondsColumn","_columnCount","_lastIndex","_addNewLeapSeconds","addNewLeapSeconds","$c1eef27c4238262a$var$onDataReady","columnNames","samples","$c1eef27c4238262a$var$compareLeapSecondDates","eop","eopData","lastTaiMinusUtc","dateColumn","xPoleWanderRadiansColumn","yPoleWanderRadiansColumn","ut1MinusUtcSecondsColumn","xCelestialPoleOffsetRadiansColumn","yCelestialPoleOffsetRadiansColumn","taiMinusUtcSecondsColumn","dates","mjd","taiMinusUtc","leapSecondIndex","$c1eef27c4238262a$var$fillResultFromIndex","columnCount","$c1eef27c4238262a$var$interpolate","before","after","y1","beforeDate","afterDate","factor","startBefore","startAfter","beforeUt1MinusUtc","afterUt1MinusUtc","offsetDifference","beforeTaiMinusUtc","afterTaiMinusUtc","dataUriRegexResult","$b1dcbeb8d31d71ff$var$decodeDataUri","mimeType","Blob","parser","DOMParser","parseFromString","$b1dcbeb8d31d71ff$var$loadWithHttpRequest","ok","forEach","status","json","arrayBuffer","withCredentials","setRequestHeader","localFile","getAllResponseHeaders","browserResponseType","splitHeaders","responseHeaderString","line","responseXML","hasChildNodes","responseText","send","_DefaultImplementations","DEFAULT","fromUrl","NONE","compute","previousIndexDate","nextIndexDate","isAfterPrevious","isAfterLastSample","isBeforeNext","$79e069d5452f6556$var$HeadingPitchRoll","denominatorRoll","numeratorRoll","denominatorHeading","numeratorHeading","asinClamped","RADIANS_PER_DEGREE","$b73be531cd978718$import_meta","assign","$b73be531cd978718$var$cesiumScriptRegex","$b73be531cd978718$var$tryMakeAbsolute","$b73be531cd978718$var$getCesiumBaseUrl","baseUrlString","CESIUM_BASE_URL","toUrlUndefined","$b73be531cd978718$var$buildModuleUrl","$b73be531cd978718$var$getBaseUrlFromCesiumScript","scripts","getAttribute","$b73be531cd978718$var$buildModuleUrlFromRequireToUrl","moduleID","$b73be531cd978718$var$buildModuleUrlFromBaseUrl","relativeUrl","_cesiumScriptRegex","_buildModuleUrlFromBaseUrl","_clearBaseResource","setBaseUrl","getCesiumBaseUrl","$c9c1200a42974c2d$export$2e2bcd8739ae039","$7212c54286490aec$var$Iau2006XysData","_xysFileUrlTemplate","xysFileUrlTemplate","_interpolationOrder","interpolationOrder","_sampleZeroJulianEphemerisDate","sampleZeroJulianEphemerisDate","_sampleZeroDateTT","_stepSizeDays","stepSizeDays","_samplesPerXysFile","samplesPerXysFile","_totalSamples","totalSamples","_chunkDownloadsInProgress","order","denom","_denominators","xTable","_xTable","stepN","pow","_work","_coef","$7212c54286490aec$var$julianDateScratch","$7212c54286490aec$var$getDaysSinceEpoch","xys","dayTT","secondTT","dateTT","$7212c54286490aec$var$requestXysChunk","xysData","chunkIndex","chunkUrl","chunk","newSamples","preload","startDayTT","startSecondTT","stopDayTT","stopSecondTT","startDaysSinceEpoch","stopDaysSinceEpoch","stopIndex","startChunk","stopChunk","promises","computeXysRadians","daysSinceEpoch","centerIndex","degree","firstIndex","isDataMissing","work","coef","sampleIndex","$19a47bf34378ad7c$var$_names","requestFullscreen","exitFullscreen","fullscreenEnabled","fullscreenElement","fullscreenchange","fullscreenerror","$19a47bf34378ad7c$var$Fullscreen","$da149e13e9eaa5f6$var$extractVersion","versionString","parseInt","$da149e13e9eaa5f6$var$isChrome","$da149e13e9eaa5f6$var$isEdge","fields","userAgent","$da149e13e9eaa5f6$var$isSafari","$da149e13e9eaa5f6$var$isWebkit","isNightly","$da149e13e9eaa5f6$var$isInternetExplorer","appName","$da149e13e9eaa5f6$var$isFirefox","$da149e13e9eaa5f6$var$supportsImageRenderingPixelated","imageRendering","$da149e13e9eaa5f6$var$supportsWebP","initialized","_result","supportsFullscreen","changeEventName","errorEventName","enabled","fullscreen","body","prefixes","prefix","vrDevice","vrDisplay","_names","navigator","_promise","initialize","$da149e13e9eaa5f6$var$typedArrayTypes","Int8Array","Int16Array","Uint16Array","Int32Array","Float64Array","Uint8ClampedArray","BigInt64Array","BigUint64Array","$da149e13e9eaa5f6$var$FeatureDetection","isChrome","chromeVersion","isSafari","safariVersion","isWebkit","webkitVersion","isInternetExplorer","internetExplorerVersion","isEdge","edgeVersion","isFirefox","firefoxVersion","isWindows","appVersion","isIPadOrIOS","platform","hardwareConcurrency","supportsPointerEvents","PointerEvent","pointerEnabled","supportsImageRenderingPixelated","supportsWebP","imageRenderingValue","typedArrayTypes","supportsBasis","scene","supportsWebAssembly","context","supportsTypedArrays","supportsBigInt64Array","supportsBigUint64Array","supportsBigInt","BigInt","supportsWebWorkers","Worker","WebAssembly","supportsWebgl2","webgl2","supportsEsmWebWorkers","$cd53d4b312c9644c$var$Quaternion","$cd53d4b312c9644c$var$fromAxisAngleScratch","fromAxisAngle","axis","halfAngle","$cd53d4b312c9644c$var$fromRotationMatrixNext","$cd53d4b312c9644c$var$fromRotationMatrixQuat","fromRotationMatrix","trace","next","quat","$cd53d4b312c9644c$var$scratchHPRQuaternion","$cd53d4b312c9644c$var$scratchHeadingQuaternion","$cd53d4b312c9644c$var$scratchPitchQuaternion","$cd53d4b312c9644c$var$scratchRollQuaternion","$cd53d4b312c9644c$var$sampledQuaternionAxis","$cd53d4b312c9644c$var$sampledQuaternionRotation","$cd53d4b312c9644c$var$sampledQuaternionTempQuaternion","$cd53d4b312c9644c$var$sampledQuaternionQuaternion0","$cd53d4b312c9644c$var$sampledQuaternionQuaternion0Conjugate","packedInterpolationLength","convertPackedArrayForInterpolation","packedArray","conjugate","computeAxis","computeAngle","unpackInterpolationResult","sourceArray","inverseMagnitude","leftX","leftY","leftZ","leftW","rightX","rightY","rightZ","rightW","EPSILON6","acos","$cd53d4b312c9644c$var$lerpScratch","$cd53d4b312c9644c$var$slerpEndNegated","$cd53d4b312c9644c$var$slerpScaledP","$cd53d4b312c9644c$var$slerpScaledR","slerp","theta","acosClamped","thetaOverSinTheta","exp","sinThetaOverTheta","$cd53d4b312c9644c$var$squadScratchCartesian0","$cd53d4b312c9644c$var$squadScratchCartesian1","$cd53d4b312c9644c$var$squadScratchQuaternion0","$cd53d4b312c9644c$var$squadScratchQuaternion1","computeInnerQuadrangle","q0","qInv","cart0","cart1","squad","s0","s1","slerp0","slerp1","$cd53d4b312c9644c$var$fastSlerpScratchQuaternion","$cd53d4b312c9644c$var$u","$cd53d4b312c9644c$var$v","$cd53d4b312c9644c$var$bT","$cd53d4b312c9644c$var$bD","$cd53d4b312c9644c$var$opmu","fastSlerp","xm1","sqrT","sqrD","cT","cD","fastSquad","$128fc127c88fc802$var$Transforms","$128fc127c88fc802$var$vectorProductLocalFrame","down","$128fc127c88fc802$var$degeneratePositionLocalFrame","$128fc127c88fc802$var$localFrameToFixedFrameCache","$128fc127c88fc802$var$scratchCalculateCartesian","$128fc127c88fc802$var$scratchFirstCartesian","$128fc127c88fc802$var$scratchSecondCartesian","$128fc127c88fc802$var$scratchThirdCartesian","localFrameToFixedFrameGenerator","firstAxis","secondAxis","resultat","thirdAxis","hashAxis","eastNorthUpToFixedFrame","northEastDownToFixedFrame","northUpEastToFixedFrame","northWestUpToFixedFrame","$128fc127c88fc802$var$scratchHPRQuaternion","$128fc127c88fc802$var$scratchScale","$128fc127c88fc802$var$scratchHPRMatrix4","headingPitchRollToFixedFrame","fixedFrameTransform","hprQuaternion","hprMatrix","$128fc127c88fc802$var$scratchENUMatrix4","$128fc127c88fc802$var$scratchHPRMatrix3","headingPitchRollQuaternion","transform","$128fc127c88fc802$var$noScale","$128fc127c88fc802$var$hprCenterScratch","$128fc127c88fc802$var$ffScratch","$128fc127c88fc802$var$hprTransformScratch","$128fc127c88fc802$var$hprRotationScratch","$128fc127c88fc802$var$hprQuaternionScratch","fixedFrameToHeadingPitchRoll","center","toFixedFrame","transformCopy","quaternionRotation","$128fc127c88fc802$var$twoPiOverSecondsInDay","$128fc127c88fc802$var$dateInUtc","computeIcrfToCentralBodyFixedMatrix","transformMatrix","computeIcrfToFixedMatrix","computeTemeToPseudoFixedMatrix","utcDayNumber","utcSecondsIntoDay","diffDays","gha","$128fc127c88fc802$var$gmstConstant0","$128fc127c88fc802$var$gmstConstant1","$128fc127c88fc802$var$gmstConstant2","$128fc127c88fc802$var$wgs84WRPrecessing","$128fc127c88fc802$var$rateCoef","cosGha","sinGha","iau2006XysData","earthOrientationParameters","preloadIcrfFixed","timeInterval","stop","fixedToIcrfMtx","computeFixedToIcrfMatrix","$128fc127c88fc802$var$scratchHpr","$128fc127c88fc802$var$scratchRotationMatrix","$128fc127c88fc802$var$dateScratch","computeMoonFixedToIcrfMatrix","secondsTT","e1","e2","e3","e4","e5","computeIcrfToMoonFixedMatrix","$128fc127c88fc802$var$xysScratch","$128fc127c88fc802$var$eopScratch","$128fc127c88fc802$var$rotation1Scratch","$128fc127c88fc802$var$rotation2Scratch","rotation1","rotation2","matrixQ","dateUt1day","fractionOfDay","dateUt1sec","era","daysSinceJ2000","earthRotation","pfToIcrf","cosxp","cosyp","sinxp","sinyp","ttt","sp","cossp","sinsp","fToPfMtx","$128fc127c88fc802$var$pointToWindowCoordinatesTemp","pointToWindowCoordinates","modelViewProjectionMatrix","viewportTransformation","point","pointToGLWindowCoordinates","fromCartesian4","$128fc127c88fc802$var$normalScratch","$128fc127c88fc802$var$rightScratch","$128fc127c88fc802$var$upScratch","rotationMatrixFromPositionVelocity","velocity","normal","$128fc127c88fc802$var$swizzleMatrix","$128fc127c88fc802$var$scratchCartographic","$128fc127c88fc802$var$scratchCartesian3Projection","$128fc127c88fc802$var$scratchCenter","$128fc127c88fc802$var$scratchRotation","$128fc127c88fc802$var$scratchFromENU","$128fc127c88fc802$var$scratchToENU","basisTo2D","projection","projectedPosition","rtcCenter","project","fromENU","toENU","local","ellipsoidTo2DModelMatrix","$0ad68ca5cf1aea2c$var$vectorScratch","$0ad68ca5cf1aea2c$var$windowPositionScratch","$0ad68ca5cf1aea2c$var$clickLocationScratch","$0ad68ca5cf1aea2c$var$centerScratch","$0ad68ca5cf1aea2c$var$oldTransformScratch","$0ad68ca5cf1aea2c$var$newTransformScratch","$0ad68ca5cf1aea2c$var$pickRayScratch","$0ad68ca5cf1aea2c$var$outerRingSvg","svg","$0ad68ca5cf1aea2c$var$innerRingSvg","$0ad68ca5cf1aea2c$var$rotationMarkerSvg","$0ad68ca5cf1aea2c$var$CesiumCompass","LitElement","clock","ready","orbitCursorAngle","orbitCursorOpacity","resetSpeed","styles","css","rotateClick","unlistenFromPostRender","unlistenFromClockTick","handleRotatePointerMoveFunction","handleRotatePointerMove","bind","handleRotatePointerUpFunction","handleRotatePointerUp","handleOrbitPointerMoveFunction","handleOrbitPointerMove","handleOrbitPointerUpFunction","handleOrbitPointerUp","handleOrbitTickFunction","handleOrbitTick","updated","postRender","outerRingStyle","rotationMarkerStyle","opacity","disconnectedCallback","handlePointerDown","compassElement","currentTarget","compassRectangle","getBoundingClientRect","compassCenter","clientX","clientY","distanceFromCenter","clientWidth","clientHeight","ray","getPickRay","viewCenter","globe","pick","frame","positionWC","distanceFraction","$0ad68ca5cf1aea2c$var$nominalGyroRadius","orbit","rotate","stopPropagation","preventDefault","cursorVector","rotateInitialCursorAngle","oldTransform","lookAtTransform","rotateInitialCameraAngle","moveUpIfTooCloseToTerrain","angleDifference","newCameraAngle","zeroToTwoPi","currentCameraAngle","rotateRight","resetToNorth","negativePiToPi","PI_OVER_TWO","duration","prevProgress","performance","step","elapsed","progress","rotateLeft","requestAnimationFrame","orbitIsLook","orbitLastTimestamp","onTick","updateAngleAndOpacity","timestamp","deltaT","look","rotateUp","distanceToTerrain","getHeight","positionCartographic","controller","screenSpaceCameraController","enableCollisionDetection","distanceDiff","minimumZoomDistance","moveUp","compassWidth","html","customElements","important","importantFlag","styleMap","directive","Directive","partInfo","super","PartType","ATTRIBUTE","styleInfo","prop","this","_previousStyleProperties","isImportant","CHILD","PROPERTY","BOOLEAN_ATTRIBUTE","EVENT","ELEMENT","_partInfo","_$isConnected","_$parent","_$initialize","attributeIndex","__part","__attributeIndex","_$resolve","props"],"version":3,"file":"cesium-compass.f610fb3a.js.map"}
\ No newline at end of file
diff --git a/cesium-compass.html b/cesium-compass.html
index 3d96470..84583bd 100644
--- a/cesium-compass.html
+++ b/cesium-compass.html
@@ -1 +1 @@
-