UNPKG

aframe-globe-component

Version:
50 lines (42 loc) 2.63 MB
/* * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development"). * This devtool is neither made for production nor for readable output files. * It uses "eval()" calls to create a separate source file in the browser devtools. * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/) * or disable the default devtool with "devtool: false". * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/). */ (function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(); else if(typeof define === 'function' && define.amd) define([], factory); else { var a = factory(); for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i]; } })(this, () => { return /******/ (() => { // webpackBootstrap /******/ var __webpack_modules__ = ({ /***/ "./node_modules/@tweenjs/tween.js/dist/tween.esm.js": /*!**********************************************************!*\ !*** ./node_modules/@tweenjs/tween.js/dist/tween.esm.js ***! \**********************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Easing\": () => (/* binding */ Easing),\n/* harmony export */ \"Group\": () => (/* binding */ Group),\n/* harmony export */ \"Interpolation\": () => (/* binding */ Interpolation),\n/* harmony export */ \"Sequence\": () => (/* binding */ Sequence),\n/* harmony export */ \"Tween\": () => (/* binding */ Tween),\n/* harmony export */ \"VERSION\": () => (/* binding */ VERSION),\n/* harmony export */ \"add\": () => (/* binding */ add),\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__),\n/* harmony export */ \"getAll\": () => (/* binding */ getAll),\n/* harmony export */ \"nextId\": () => (/* binding */ nextId),\n/* harmony export */ \"now\": () => (/* binding */ now$1),\n/* harmony export */ \"remove\": () => (/* binding */ remove),\n/* harmony export */ \"removeAll\": () => (/* binding */ removeAll),\n/* harmony export */ \"update\": () => (/* binding */ update)\n/* harmony export */ });\n/**\n * The Ease class provides a collection of easing functions for use with tween.js.\n */\nvar Easing = {\n Linear: {\n None: function (amount) {\n return amount;\n },\n },\n Quadratic: {\n In: function (amount) {\n return amount * amount;\n },\n Out: function (amount) {\n return amount * (2 - amount);\n },\n InOut: function (amount) {\n if ((amount *= 2) < 1) {\n return 0.5 * amount * amount;\n }\n return -0.5 * (--amount * (amount - 2) - 1);\n },\n },\n Cubic: {\n In: function (amount) {\n return amount * amount * amount;\n },\n Out: function (amount) {\n return --amount * amount * amount + 1;\n },\n InOut: function (amount) {\n if ((amount *= 2) < 1) {\n return 0.5 * amount * amount * amount;\n }\n return 0.5 * ((amount -= 2) * amount * amount + 2);\n },\n },\n Quartic: {\n In: function (amount) {\n return amount * amount * amount * amount;\n },\n Out: function (amount) {\n return 1 - --amount * amount * amount * amount;\n },\n InOut: function (amount) {\n if ((amount *= 2) < 1) {\n return 0.5 * amount * amount * amount * amount;\n }\n return -0.5 * ((amount -= 2) * amount * amount * amount - 2);\n },\n },\n Quintic: {\n In: function (amount) {\n return amount * amount * amount * amount * amount;\n },\n Out: function (amount) {\n return --amount * amount * amount * amount * amount + 1;\n },\n InOut: function (amount) {\n if ((amount *= 2) < 1) {\n return 0.5 * amount * amount * amount * amount * amount;\n }\n return 0.5 * ((amount -= 2) * amount * amount * amount * amount + 2);\n },\n },\n Sinusoidal: {\n In: function (amount) {\n return 1 - Math.cos((amount * Math.PI) / 2);\n },\n Out: function (amount) {\n return Math.sin((amount * Math.PI) / 2);\n },\n InOut: function (amount) {\n return 0.5 * (1 - Math.cos(Math.PI * amount));\n },\n },\n Exponential: {\n In: function (amount) {\n return amount === 0 ? 0 : Math.pow(1024, amount - 1);\n },\n Out: function (amount) {\n return amount === 1 ? 1 : 1 - Math.pow(2, -10 * amount);\n },\n InOut: function (amount) {\n if (amount === 0) {\n return 0;\n }\n if (amount === 1) {\n return 1;\n }\n if ((amount *= 2) < 1) {\n return 0.5 * Math.pow(1024, amount - 1);\n }\n return 0.5 * (-Math.pow(2, -10 * (amount - 1)) + 2);\n },\n },\n Circular: {\n In: function (amount) {\n return 1 - Math.sqrt(1 - amount * amount);\n },\n Out: function (amount) {\n return Math.sqrt(1 - --amount * amount);\n },\n InOut: function (amount) {\n if ((amount *= 2) < 1) {\n return -0.5 * (Math.sqrt(1 - amount * amount) - 1);\n }\n return 0.5 * (Math.sqrt(1 - (amount -= 2) * amount) + 1);\n },\n },\n Elastic: {\n In: function (amount) {\n if (amount === 0) {\n return 0;\n }\n if (amount === 1) {\n return 1;\n }\n return -Math.pow(2, 10 * (amount - 1)) * Math.sin((amount - 1.1) * 5 * Math.PI);\n },\n Out: function (amount) {\n if (amount === 0) {\n return 0;\n }\n if (amount === 1) {\n return 1;\n }\n return Math.pow(2, -10 * amount) * Math.sin((amount - 0.1) * 5 * Math.PI) + 1;\n },\n InOut: function (amount) {\n if (amount === 0) {\n return 0;\n }\n if (amount === 1) {\n return 1;\n }\n amount *= 2;\n if (amount < 1) {\n return -0.5 * Math.pow(2, 10 * (amount - 1)) * Math.sin((amount - 1.1) * 5 * Math.PI);\n }\n return 0.5 * Math.pow(2, -10 * (amount - 1)) * Math.sin((amount - 1.1) * 5 * Math.PI) + 1;\n },\n },\n Back: {\n In: function (amount) {\n var s = 1.70158;\n return amount * amount * ((s + 1) * amount - s);\n },\n Out: function (amount) {\n var s = 1.70158;\n return --amount * amount * ((s + 1) * amount + s) + 1;\n },\n InOut: function (amount) {\n var s = 1.70158 * 1.525;\n if ((amount *= 2) < 1) {\n return 0.5 * (amount * amount * ((s + 1) * amount - s));\n }\n return 0.5 * ((amount -= 2) * amount * ((s + 1) * amount + s) + 2);\n },\n },\n Bounce: {\n In: function (amount) {\n return 1 - Easing.Bounce.Out(1 - amount);\n },\n Out: function (amount) {\n if (amount < 1 / 2.75) {\n return 7.5625 * amount * amount;\n }\n else if (amount < 2 / 2.75) {\n return 7.5625 * (amount -= 1.5 / 2.75) * amount + 0.75;\n }\n else if (amount < 2.5 / 2.75) {\n return 7.5625 * (amount -= 2.25 / 2.75) * amount + 0.9375;\n }\n else {\n return 7.5625 * (amount -= 2.625 / 2.75) * amount + 0.984375;\n }\n },\n InOut: function (amount) {\n if (amount < 0.5) {\n return Easing.Bounce.In(amount * 2) * 0.5;\n }\n return Easing.Bounce.Out(amount * 2 - 1) * 0.5 + 0.5;\n },\n },\n};\n\nvar now;\n// Include a performance.now polyfill.\n// In node.js, use process.hrtime.\n// eslint-disable-next-line\n// @ts-ignore\nif (typeof self === 'undefined' && typeof process !== 'undefined' && process.hrtime) {\n now = function () {\n // eslint-disable-next-line\n // @ts-ignore\n var time = process.hrtime();\n // Convert [seconds, nanoseconds] to milliseconds.\n return time[0] * 1000 + time[1] / 1000000;\n };\n}\n// In a browser, use self.performance.now if it is available.\nelse if (typeof self !== 'undefined' && self.performance !== undefined && self.performance.now !== undefined) {\n // This must be bound, because directly assigning this function\n // leads to an invocation exception in Chrome.\n now = self.performance.now.bind(self.performance);\n}\n// Use Date.now if it is available.\nelse if (Date.now !== undefined) {\n now = Date.now;\n}\n// Otherwise, use 'new Date().getTime()'.\nelse {\n now = function () {\n return new Date().getTime();\n };\n}\nvar now$1 = now;\n\n/**\n * Controlling groups of tweens\n *\n * Using the TWEEN singleton to manage your tweens can cause issues in large apps with many components.\n * In these cases, you may want to create your own smaller groups of tween\n */\nvar Group = /** @class */ (function () {\n function Group() {\n this._tweens = {};\n this._tweensAddedDuringUpdate = {};\n }\n Group.prototype.getAll = function () {\n var _this = this;\n return Object.keys(this._tweens).map(function (tweenId) {\n return _this._tweens[tweenId];\n });\n };\n Group.prototype.removeAll = function () {\n this._tweens = {};\n };\n Group.prototype.add = function (tween) {\n this._tweens[tween.getId()] = tween;\n this._tweensAddedDuringUpdate[tween.getId()] = tween;\n };\n Group.prototype.remove = function (tween) {\n delete this._tweens[tween.getId()];\n delete this._tweensAddedDuringUpdate[tween.getId()];\n };\n Group.prototype.update = function (time, preserve) {\n if (time === void 0) { time = now$1(); }\n if (preserve === void 0) { preserve = false; }\n var tweenIds = Object.keys(this._tweens);\n if (tweenIds.length === 0) {\n return false;\n }\n // Tweens are updated in \"batches\". If you add a new tween during an\n // update, then the new tween will be updated in the next batch.\n // If you remove a tween during an update, it may or may not be updated.\n // However, if the removed tween was added during the current batch,\n // then it will not be updated.\n while (tweenIds.length > 0) {\n this._tweensAddedDuringUpdate = {};\n for (var i = 0; i < tweenIds.length; i++) {\n var tween = this._tweens[tweenIds[i]];\n var autoStart = !preserve;\n if (tween && tween.update(time, autoStart) === false && !preserve) {\n delete this._tweens[tweenIds[i]];\n }\n }\n tweenIds = Object.keys(this._tweensAddedDuringUpdate);\n }\n return true;\n };\n return Group;\n}());\n\n/**\n *\n */\nvar Interpolation = {\n Linear: function (v, k) {\n var m = v.length - 1;\n var f = m * k;\n var i = Math.floor(f);\n var fn = Interpolation.Utils.Linear;\n if (k < 0) {\n return fn(v[0], v[1], f);\n }\n if (k > 1) {\n return fn(v[m], v[m - 1], m - f);\n }\n return fn(v[i], v[i + 1 > m ? m : i + 1], f - i);\n },\n Bezier: function (v, k) {\n var b = 0;\n var n = v.length - 1;\n var pw = Math.pow;\n var bn = Interpolation.Utils.Bernstein;\n for (var i = 0; i <= n; i++) {\n b += pw(1 - k, n - i) * pw(k, i) * v[i] * bn(n, i);\n }\n return b;\n },\n CatmullRom: function (v, k) {\n var m = v.length - 1;\n var f = m * k;\n var i = Math.floor(f);\n var fn = Interpolation.Utils.CatmullRom;\n if (v[0] === v[m]) {\n if (k < 0) {\n i = Math.floor((f = m * (1 + k)));\n }\n return fn(v[(i - 1 + m) % m], v[i], v[(i + 1) % m], v[(i + 2) % m], f - i);\n }\n else {\n if (k < 0) {\n return v[0] - (fn(v[0], v[0], v[1], v[1], -f) - v[0]);\n }\n if (k > 1) {\n return v[m] - (fn(v[m], v[m], v[m - 1], v[m - 1], f - m) - v[m]);\n }\n return fn(v[i ? i - 1 : 0], v[i], v[m < i + 1 ? m : i + 1], v[m < i + 2 ? m : i + 2], f - i);\n }\n },\n Utils: {\n Linear: function (p0, p1, t) {\n return (p1 - p0) * t + p0;\n },\n Bernstein: function (n, i) {\n var fc = Interpolation.Utils.Factorial;\n return fc(n) / fc(i) / fc(n - i);\n },\n Factorial: (function () {\n var a = [1];\n return function (n) {\n var s = 1;\n if (a[n]) {\n return a[n];\n }\n for (var i = n; i > 1; i--) {\n s *= i;\n }\n a[n] = s;\n return s;\n };\n })(),\n CatmullRom: function (p0, p1, p2, p3, t) {\n var v0 = (p2 - p0) * 0.5;\n var v1 = (p3 - p1) * 0.5;\n var t2 = t * t;\n var t3 = t * t2;\n return (2 * p1 - 2 * p2 + v0 + v1) * t3 + (-3 * p1 + 3 * p2 - 2 * v0 - v1) * t2 + v0 * t + p1;\n },\n },\n};\n\n/**\n * Utils\n */\nvar Sequence = /** @class */ (function () {\n function Sequence() {\n }\n Sequence.nextId = function () {\n return Sequence._nextId++;\n };\n Sequence._nextId = 0;\n return Sequence;\n}());\n\nvar mainGroup = new Group();\n\n/**\n * Tween.js - Licensed under the MIT license\n * https://github.com/tweenjs/tween.js\n * ----------------------------------------------\n *\n * See https://github.com/tweenjs/tween.js/graphs/contributors for the full list of contributors.\n * Thank you all, you're awesome!\n */\nvar Tween = /** @class */ (function () {\n function Tween(_object, _group) {\n if (_group === void 0) { _group = mainGroup; }\n this._object = _object;\n this._group = _group;\n this._isPaused = false;\n this._pauseStart = 0;\n this._valuesStart = {};\n this._valuesEnd = {};\n this._valuesStartRepeat = {};\n this._duration = 1000;\n this._initialRepeat = 0;\n this._repeat = 0;\n this._yoyo = false;\n this._isPlaying = false;\n this._reversed = false;\n this._delayTime = 0;\n this._startTime = 0;\n this._easingFunction = Easing.Linear.None;\n this._interpolationFunction = Interpolation.Linear;\n this._chainedTweens = [];\n this._onStartCallbackFired = false;\n this._id = Sequence.nextId();\n this._isChainStopped = false;\n this._goToEnd = false;\n }\n Tween.prototype.getId = function () {\n return this._id;\n };\n Tween.prototype.isPlaying = function () {\n return this._isPlaying;\n };\n Tween.prototype.isPaused = function () {\n return this._isPaused;\n };\n Tween.prototype.to = function (properties, duration) {\n // TODO? restore this, then update the 07_dynamic_to example to set fox\n // tween's to on each update. That way the behavior is opt-in (there's\n // currently no opt-out).\n // for (const prop in properties) this._valuesEnd[prop] = properties[prop]\n this._valuesEnd = Object.create(properties);\n if (duration !== undefined) {\n this._duration = duration;\n }\n return this;\n };\n Tween.prototype.duration = function (d) {\n this._duration = d;\n return this;\n };\n Tween.prototype.start = function (time) {\n if (this._isPlaying) {\n return this;\n }\n // eslint-disable-next-line\n this._group && this._group.add(this);\n this._repeat = this._initialRepeat;\n if (this._reversed) {\n // If we were reversed (f.e. using the yoyo feature) then we need to\n // flip the tween direction back to forward.\n this._reversed = false;\n for (var property in this._valuesStartRepeat) {\n this._swapEndStartRepeatValues(property);\n this._valuesStart[property] = this._valuesStartRepeat[property];\n }\n }\n this._isPlaying = true;\n this._isPaused = false;\n this._onStartCallbackFired = false;\n this._isChainStopped = false;\n this._startTime = time !== undefined ? (typeof time === 'string' ? now$1() + parseFloat(time) : time) : now$1();\n this._startTime += this._delayTime;\n this._setupProperties(this._object, this._valuesStart, this._valuesEnd, this._valuesStartRepeat);\n return this;\n };\n Tween.prototype._setupProperties = function (_object, _valuesStart, _valuesEnd, _valuesStartRepeat) {\n for (var property in _valuesEnd) {\n var startValue = _object[property];\n var startValueIsArray = Array.isArray(startValue);\n var propType = startValueIsArray ? 'array' : typeof startValue;\n var isInterpolationList = !startValueIsArray && Array.isArray(_valuesEnd[property]);\n // If `to()` specifies a property that doesn't exist in the source object,\n // we should not set that property in the object\n if (propType === 'undefined' || propType === 'function') {\n continue;\n }\n // Check if an Array was provided as property value\n if (isInterpolationList) {\n var endValues = _valuesEnd[property];\n if (endValues.length === 0) {\n continue;\n }\n // handle an array of relative values\n endValues = endValues.map(this._handleRelativeValue.bind(this, startValue));\n // Create a local copy of the Array with the start value at the front\n _valuesEnd[property] = [startValue].concat(endValues);\n }\n // handle the deepness of the values\n if ((propType === 'object' || startValueIsArray) && startValue && !isInterpolationList) {\n _valuesStart[property] = startValueIsArray ? [] : {};\n // eslint-disable-next-line\n for (var prop in startValue) {\n // eslint-disable-next-line\n // @ts-ignore FIXME?\n _valuesStart[property][prop] = startValue[prop];\n }\n _valuesStartRepeat[property] = startValueIsArray ? [] : {}; // TODO? repeat nested values? And yoyo? And array values?\n // eslint-disable-next-line\n // @ts-ignore FIXME?\n this._setupProperties(startValue, _valuesStart[property], _valuesEnd[property], _valuesStartRepeat[property]);\n }\n else {\n // Save the starting value, but only once.\n if (typeof _valuesStart[property] === 'undefined') {\n _valuesStart[property] = startValue;\n }\n if (!startValueIsArray) {\n // eslint-disable-next-line\n // @ts-ignore FIXME?\n _valuesStart[property] *= 1.0; // Ensures we're using numbers, not strings\n }\n if (isInterpolationList) {\n // eslint-disable-next-line\n // @ts-ignore FIXME?\n _valuesStartRepeat[property] = _valuesEnd[property].slice().reverse();\n }\n else {\n _valuesStartRepeat[property] = _valuesStart[property] || 0;\n }\n }\n }\n };\n Tween.prototype.stop = function () {\n if (!this._isChainStopped) {\n this._isChainStopped = true;\n this.stopChainedTweens();\n }\n if (!this._isPlaying) {\n return this;\n }\n // eslint-disable-next-line\n this._group && this._group.remove(this);\n this._isPlaying = false;\n this._isPaused = false;\n if (this._onStopCallback) {\n this._onStopCallback(this._object);\n }\n return this;\n };\n Tween.prototype.end = function () {\n this._goToEnd = true;\n this.update(Infinity);\n return this;\n };\n Tween.prototype.pause = function (time) {\n if (time === void 0) { time = now$1(); }\n if (this._isPaused || !this._isPlaying) {\n return this;\n }\n this._isPaused = true;\n this._pauseStart = time;\n // eslint-disable-next-line\n this._group && this._group.remove(this);\n return this;\n };\n Tween.prototype.resume = function (time) {\n if (time === void 0) { time = now$1(); }\n if (!this._isPaused || !this._isPlaying) {\n return this;\n }\n this._isPaused = false;\n this._startTime += time - this._pauseStart;\n this._pauseStart = 0;\n // eslint-disable-next-line\n this._group && this._group.add(this);\n return this;\n };\n Tween.prototype.stopChainedTweens = function () {\n for (var i = 0, numChainedTweens = this._chainedTweens.length; i < numChainedTweens; i++) {\n this._chainedTweens[i].stop();\n }\n return this;\n };\n Tween.prototype.group = function (group) {\n this._group = group;\n return this;\n };\n Tween.prototype.delay = function (amount) {\n this._delayTime = amount;\n return this;\n };\n Tween.prototype.repeat = function (times) {\n this._initialRepeat = times;\n this._repeat = times;\n return this;\n };\n Tween.prototype.repeatDelay = function (amount) {\n this._repeatDelayTime = amount;\n return this;\n };\n Tween.prototype.yoyo = function (yoyo) {\n this._yoyo = yoyo;\n return this;\n };\n Tween.prototype.easing = function (easingFunction) {\n this._easingFunction = easingFunction;\n return this;\n };\n Tween.prototype.interpolation = function (interpolationFunction) {\n this._interpolationFunction = interpolationFunction;\n return this;\n };\n Tween.prototype.chain = function () {\n var tweens = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n tweens[_i] = arguments[_i];\n }\n this._chainedTweens = tweens;\n return this;\n };\n Tween.prototype.onStart = function (callback) {\n this._onStartCallback = callback;\n return this;\n };\n Tween.prototype.onUpdate = function (callback) {\n this._onUpdateCallback = callback;\n return this;\n };\n Tween.prototype.onRepeat = function (callback) {\n this._onRepeatCallback = callback;\n return this;\n };\n Tween.prototype.onComplete = function (callback) {\n this._onCompleteCallback = callback;\n return this;\n };\n Tween.prototype.onStop = function (callback) {\n this._onStopCallback = callback;\n return this;\n };\n /**\n * @returns true if the tween is still playing after the update, false\n * otherwise (calling update on a paused tween still returns true because\n * it is still playing, just paused).\n */\n Tween.prototype.update = function (time, autoStart) {\n if (time === void 0) { time = now$1(); }\n if (autoStart === void 0) { autoStart = true; }\n if (this._isPaused)\n return true;\n var property;\n var elapsed;\n var endTime = this._startTime + this._duration;\n if (!this._goToEnd && !this._isPlaying) {\n if (time > endTime)\n return false;\n if (autoStart)\n this.start(time);\n }\n this._goToEnd = false;\n if (time < this._startTime) {\n return true;\n }\n if (this._onStartCallbackFired === false) {\n if (this._onStartCallback) {\n this._onStartCallback(this._object);\n }\n this._onStartCallbackFired = true;\n }\n elapsed = (time - this._startTime) / this._duration;\n elapsed = this._duration === 0 || elapsed > 1 ? 1 : elapsed;\n var value = this._easingFunction(elapsed);\n // properties transformations\n this._updateProperties(this._object, this._valuesStart, this._valuesEnd, value);\n if (this._onUpdateCallback) {\n this._onUpdateCallback(this._object, elapsed);\n }\n if (elapsed === 1) {\n if (this._repeat > 0) {\n if (isFinite(this._repeat)) {\n this._repeat--;\n }\n // Reassign starting values, restart by making startTime = now\n for (property in this._valuesStartRepeat) {\n if (!this._yoyo && typeof this._valuesEnd[property] === 'string') {\n this._valuesStartRepeat[property] =\n // eslint-disable-next-line\n // @ts-ignore FIXME?\n this._valuesStartRepeat[property] + parseFloat(this._valuesEnd[property]);\n }\n if (this._yoyo) {\n this._swapEndStartRepeatValues(property);\n }\n this._valuesStart[property] = this._valuesStartRepeat[property];\n }\n if (this._yoyo) {\n this._reversed = !this._reversed;\n }\n if (this._repeatDelayTime !== undefined) {\n this._startTime = time + this._repeatDelayTime;\n }\n else {\n this._startTime = time + this._delayTime;\n }\n if (this._onRepeatCallback) {\n this._onRepeatCallback(this._object);\n }\n return true;\n }\n else {\n if (this._onCompleteCallback) {\n this._onCompleteCallback(this._object);\n }\n for (var i = 0, numChainedTweens = this._chainedTweens.length; i < numChainedTweens; i++) {\n // Make the chained tweens start exactly at the time they should,\n // even if the `update()` method was called way past the duration of the tween\n this._chainedTweens[i].start(this._startTime + this._duration);\n }\n this._isPlaying = false;\n return false;\n }\n }\n return true;\n };\n Tween.prototype._updateProperties = function (_object, _valuesStart, _valuesEnd, value) {\n for (var property in _valuesEnd) {\n // Don't update properties that do not exist in the source object\n if (_valuesStart[property] === undefined) {\n continue;\n }\n var start = _valuesStart[property] || 0;\n var end = _valuesEnd[property];\n var startIsArray = Array.isArray(_object[property]);\n var endIsArray = Array.isArray(end);\n var isInterpolationList = !startIsArray && endIsArray;\n if (isInterpolationList) {\n _object[property] = this._interpolationFunction(end, value);\n }\n else if (typeof end === 'object' && end) {\n // eslint-disable-next-line\n // @ts-ignore FIXME?\n this._updateProperties(_object[property], start, end, value);\n }\n else {\n // Parses relative end values with start as base (e.g.: +10, -3)\n end = this._handleRelativeValue(start, end);\n // Protect against non numeric properties.\n if (typeof end === 'number') {\n // eslint-disable-next-line\n // @ts-ignore FIXME?\n _object[property] = start + (end - start) * value;\n }\n }\n }\n };\n Tween.prototype._handleRelativeValue = function (start, end) {\n if (typeof end !== 'string') {\n return end;\n }\n if (end.charAt(0) === '+' || end.charAt(0) === '-') {\n return start + parseFloat(end);\n }\n else {\n return parseFloat(end);\n }\n };\n Tween.prototype._swapEndStartRepeatValues = function (property) {\n var tmp = this._valuesStartRepeat[property];\n var endValue = this._valuesEnd[property];\n if (typeof endValue === 'string') {\n this._valuesStartRepeat[property] = this._valuesStartRepeat[property] + parseFloat(endValue);\n }\n else {\n this._valuesStartRepeat[property] = this._valuesEnd[property];\n }\n this._valuesEnd[property] = tmp;\n };\n return Tween;\n}());\n\nvar VERSION = '18.6.4';\n\n/**\n * Tween.js - Licensed under the MIT license\n * https://github.com/tweenjs/tween.js\n * ----------------------------------------------\n *\n * See https://github.com/tweenjs/tween.js/graphs/contributors for the full list of contributors.\n * Thank you all, you're awesome!\n */\nvar nextId = Sequence.nextId;\n/**\n * Controlling groups of tweens\n *\n * Using the TWEEN singleton to manage your tweens can cause issues in large apps with many components.\n * In these cases, you may want to create your own smaller groups of tweens.\n */\nvar TWEEN = mainGroup;\n// This is the best way to export things in a way that's compatible with both ES\n// Modules and CommonJS, without build hacks, and so as not to break the\n// existing API.\n// https://github.com/rollup/rollup/issues/1961#issuecomment-423037881\nvar getAll = TWEEN.getAll.bind(TWEEN);\nvar removeAll = TWEEN.removeAll.bind(TWEEN);\nvar add = TWEEN.add.bind(TWEEN);\nvar remove = TWEEN.remove.bind(TWEEN);\nvar update = TWEEN.update.bind(TWEEN);\nvar exports = {\n Easing: Easing,\n Group: Group,\n Interpolation: Interpolation,\n now: now$1,\n Sequence: Sequence,\n nextId: nextId,\n Tween: Tween,\n VERSION: VERSION,\n getAll: getAll,\n removeAll: removeAll,\n add: add,\n remove: remove,\n update: update,\n};\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (exports);\n\n\n\n//# sourceURL=webpack://aframe-globe-component/./node_modules/@tweenjs/tween.js/dist/tween.esm.js?"); /***/ }), /***/ "./node_modules/accessor-fn/dist/accessor-fn.module.js": /*!*************************************************************!*\ !*** ./node_modules/accessor-fn/dist/accessor-fn.module.js ***! \*************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\nvar index = (function (p) {\n return p instanceof Function ? p // fn\n : typeof p === 'string' ? function (obj) {\n return obj[p];\n } // property name\n : function (obj) {\n return p;\n };\n}); // constant\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (index);\n\n\n//# sourceURL=webpack://aframe-globe-component/./node_modules/accessor-fn/dist/accessor-fn.module.js?"); /***/ }), /***/ "./index.js": /*!******************!*\ !*** ./index.js ***! \******************/ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { eval("/* global AFRAME */\n\nif (typeof AFRAME === 'undefined') {\n throw new Error('Component attempted to register before AFRAME was available.');\n}\nlet accessorFn = __webpack_require__(/*! accessor-fn */ \"./node_modules/accessor-fn/dist/accessor-fn.module.js\");\nif ('default' in accessorFn) {\n // unwrap default export\n accessorFn = accessorFn.default;\n}\nlet ThreeGlobe = __webpack_require__(/*! three-globe */ \"./node_modules/three-globe/dist/three-globe.module.js\");\nif ('default' in ThreeGlobe) {\n // unwrap default export\n ThreeGlobe = ThreeGlobe.default;\n}\nconst parseJson = function (prop) {\n return typeof prop === 'string' ? JSON.parse(prop) : prop; // already parsed\n};\n\nconst parseFn = function (prop) {\n if (typeof prop === 'function') return prop; // already a function\n const geval = eval; // Avoid using eval directly https://github.com/rollup/rollup/wiki/Troubleshooting#avoiding-eval\n try {\n const evalled = geval('(' + prop + ')');\n return evalled;\n } catch (e) {} // Can't eval, not a function\n return null;\n};\nconst parseAccessor = function (prop) {\n if (!isNaN(parseFloat(prop))) {\n return parseFloat(prop);\n } // parse numbers\n if (parseFn(prop)) {\n return parseFn(prop);\n } // parse functions\n return prop; // strings\n};\n\n/**\n * 3D Globe component for A-Frame.\n */\nAFRAME.registerComponent('globe', {\n schema: {\n onHover: {\n parse: parseFn,\n default: null\n },\n onClick: {\n parse: parseFn,\n default: null\n },\n globeImageUrl: {\n type: 'string',\n default: ''\n },\n bumpImageUrl: {\n type: 'string',\n default: ''\n },\n showGlobe: {\n type: 'boolean',\n default: true\n },\n showGraticules: {\n type: 'boolean',\n default: false\n },\n showAtmosphere: {\n type: 'boolean',\n default: true\n },\n atmosphereColor: {\n type: 'string',\n default: 'lightskyblue'\n },\n atmosphereAltitude: {\n type: 'number',\n default: 0.15\n },\n onGlobeReady: {\n parse: parseFn,\n default: null\n },\n pointsData: {\n parse: parseJson,\n default: []\n },\n pointLat: {\n parse: parseAccessor,\n default: 'lat'\n },\n pointLng: {\n parse: parseAccessor,\n default: 'lng'\n },\n pointColor: {\n parse: parseAccessor,\n default: function () {\n return '#ffffaa';\n }\n },\n pointAltitude: {\n parse: parseAccessor,\n default: 0.1\n },\n pointRadius: {\n parse: parseAccessor,\n default: 0.25\n },\n pointResolution: {\n type: 'number',\n default: 12\n },\n pointsMerge: {\n type: 'boolean',\n default: false\n },\n pointsTransitionDuration: {\n type: 'number',\n default: 1000\n },\n arcsData: {\n parse: parseJson,\n default: []\n },\n arcStartLat: {\n parse: parseAccessor,\n default: 'startLat'\n },\n arcStartLng: {\n parse: parseAccessor,\n default: 'startLng'\n },\n arcEndLat: {\n parse: parseAccessor,\n default: 'endLat'\n },\n arcEndLng: {\n parse: parseAccessor,\n default: 'endLng'\n },\n arcColor: {\n parse: parseAccessor,\n default: function () {\n return '#ffffaa';\n }\n },\n arcAltitude: {\n parse: parseAccessor,\n default: null\n },\n arcAltitudeAutoScale: {\n parse: parseAccessor,\n default: 0.5\n },\n arcStroke: {\n parse: parseAccessor,\n default: null\n },\n arcCurveResolution: {\n type: 'number',\n default: 64\n },\n arcCircularResolution: {\n type: 'number',\n default: 6\n },\n arcDashLength: {\n parse: parseAccessor,\n default: 1\n },\n arcDashGap: {\n parse: parseAccessor,\n default: 0\n },\n arcDashInitialGap: {\n parse: parseAccessor,\n default: 0\n },\n arcDashAnimateTime: {\n parse: parseAccessor,\n default: 0\n },\n arcsTransitionDuration: {\n type: 'number',\n default: 1000\n },\n polygonsData: {\n parse: parseJson,\n default: []\n },\n polygonGeoJsonGeometry: {\n parse: parseAccessor,\n default: 'geometry'\n },\n polygonCapColor: {\n parse: parseAccessor,\n default: function () {\n return '#ffffaa';\n }\n },\n polygonCapMaterial: {\n parse: parseAccessor,\n default: null\n },\n polygonSideColor: {\n parse: parseAccessor,\n default: function () {\n return '#ffffaa';\n }\n },\n polygonSideMaterial: {\n parse: parseAccessor,\n default: null\n },\n polygonStrokeColor: {\n parse: parseAccessor,\n default: null\n },\n polygonAltitude: {\n parse: parseAccessor,\n default: 0.01\n },\n polygonCapCurvatureResolution: {\n parse: parseAccessor,\n default: 5\n },\n polygonsTransitionDuration: {\n type: 'number',\n default: 1000\n },\n pathsData: {\n parse: parseJson,\n default: []\n },\n pathPoints: {\n parse: parseAccessor,\n default: function (pnts) {\n return pnts;\n }\n },\n pathPointLat: {\n parse: parseAccessor,\n default: function (arr) {\n return arr[0];\n }\n },\n pathPointLng: {\n parse: parseAccessor,\n default: function (arr) {\n return arr[1];\n }\n },\n pathPointAlt: {\n parse: parseAccessor,\n default: 1e-3\n },\n pathResolution: {\n type: 'number',\n default: 2\n },\n pathColor: {\n parse: parseAccessor,\n default: function () {\n return '#ffffaa';\n }\n },\n pathStroke: {\n parse: parseAccessor,\n default: null\n },\n pathDashLength: {\n parse: parseAccessor,\n default: 1\n },\n pathDashGap: {\n parse: parseAccessor,\n default: 0\n },\n pathDashInitialGap: {\n parse: parseAccessor,\n default: 0\n },\n pathDashAnimateTime: {\n parse: parseAccessor,\n default: 0\n },\n pathTransitionDuration: {\n type: 'number',\n default: 1000\n },\n hexBinPointsData: {\n parse: parseJson,\n default: []\n },\n hexBinPointLat: {\n parse: parseAccessor,\n default: 'lat'\n },\n hexBinPointLng: {\n parse: parseAccessor,\n default: 'lng'\n },\n hexBinPointWeight: {\n parse: parseAccessor,\n default: 1\n },\n hexBinResolution: {\n type: 'number',\n default: 4\n },\n hexMargin: {\n parse: parseAccessor,\n default: 0.2\n },\n hexTopCurvatureResolution: {\n type: 'number',\n default: 5\n },\n hexTopColor: {\n parse: parseAccessor,\n default: function () {\n return '#ffffaa';\n }\n },\n hexSideColor: {\n parse: parseAccessor,\n default: function () {\n return '#ffffaa';\n }\n },\n hexAltitude: {\n parse: parseAccessor,\n default: function (d) {\n return d.sumWeight * 0.01;\n }\n },\n hexBinMerge: {\n type: 'boolean',\n default: false\n },\n hexTransitionDuration: {\n type: 'number',\n default: 1000\n },\n hexPolygonsData: {\n parse: parseJson,\n default: []\n },\n hexPolygonGeoJsonGeometry: {\n parse: parseAccessor,\n default: 'geometry'\n },\n hexPolygonColor: {\n parse: parseAccessor,\n default: function () {\n return '#ffffaa';\n }\n },\n hexPolygonAltitude: {\n parse: parseAccessor,\n default: 0.001\n },\n hexPolygonResolution: {\n parse: parseAccessor,\n default: 3\n },\n hexPolygonMargin: {\n parse: parseAccessor,\n default: 0.2\n },\n hexPolygonCurvatureResolution: {\n parse: parseAccessor,\n default: 5\n },\n hexPolygonsTransitionDuration: {\n type: 'number',\n default: 0\n },\n tilesData: {\n parse: parseJson,\n default: []\n },\n tileLat: {\n parse: parseAccessor,\n default: 'lat'\n },\n tileLng: {\n parse: parseAccessor,\n default: 'lng'\n },\n tileAltitude: {\n parse: parseAccessor,\n default: 0.01\n },\n tileWidth: {\n parse: parseAccessor,\n default: 1\n },\n tileHeight: {\n parse: parseAccessor,\n default: 1\n },\n tileUseGlobeProjection: {\n parse: parseAccessor,\n default: true\n },\n tileMaterial: {\n parse: parseAccessor,\n default: undefined\n },\n tileCurvatureResolution: {\n parse: parseAccessor,\n default: 5\n },\n tilesTransitionDuration: {\n type: 'number',\n default: 1000\n },\n ringsData: {\n parse: parseJson,\n default: []\n },\n ringLat: {\n parse: parseAccessor,\n default: 'lat'\n },\n ringLng: {\n parse: parseAccessor,\n default: 'lng'\n },\n ringAltitude: {\n parse: parseAccessor,\n default: 1.5e-3\n },\n ringColor: {\n parse: parseAccessor,\n default: function () {\n return '#ffffaa';\n }\n },\n ringResolution: {\n type: 'number',\n default: 64\n },\n ringMaxRadius: {\n parse: parseAccessor,\n default: 2\n },\n ringPropagationSpeed: {\n parse: parseAccessor,\n default: 1\n },\n ringRepeatPeriod: {\n parse: parseAccessor,\n default: 700\n },\n labelsData: {\n parse: parseJson,\n default: []\n },\n labelLat: {\n parse: parseAccessor,\n default: 'lat'\n },\n labelLng: {\n parse: parseAccessor,\n default: 'lng'\n },\n labelAltitude: {\n parse: parseAccessor,\n default: 0\n },\n labelRotation: {\n parse: parseAccessor,\n default: 0\n },\n labelText: {\n parse: parseAccessor,\n default: 'text'\n },\n labelSize: {\n parse: parseAccessor,\n default: 0.5\n },\n labelTypeFace: {\n parse: parseJson,\n default: undefined\n },\n labelColor: {\n parse: parseAccessor,\n default: function () {\n return 'lightgrey';\n }\n },\n labelResolution: {\n type: 'number',\n default: 3\n },\n labelIncludeDot: {\n parse: parseAccessor,\n default: true\n },\n labelDotRadius: {\n parse: parseAccessor,\n default: 0.1\n },\n labelDotOrientation: {\n parse: parseAccessor,\n default: function () {\n return 'bottom';\n }\n },\n labelsTransitionDuration: {\n type: 'number',\n default: 1000\n },\n objectsData: {\n parse: parseJson,\n default: []\n },\n objectLat: {\n parse: parseAccessor,\n default: 'lat'\n },\n objectLng: {\n parse: parseAccessor,\n default: 'lng'\n },\n objectAltitude: {\n parse: parseAccessor,\n default: 0.01\n },\n objectThreeObject: {\n parse: parseAccessor,\n default: undefined\n },\n customLayerData: {\n parse: parseJson,\n default: []\n },\n customThreeObject: {\n parse: parseAccessor,\n default: null\n },\n customThreeObjectUpdate: {\n parse: parseAccessor,\n default: null\n }\n },\n // Bind component methods\n globeMaterial: function () {\n if (!this.globe) {\n // Got here before component init -> initialize globe\n this.globe = new ThreeGlobe();\n }\n const globe = this.globe;\n const returnVal = globe.globeMaterial.apply(globe, arguments);\n return returnVal === globe ? this // return self, not the inner globe component\n : returnVal;\n },\n getGlobeRadius: function () {\n if (!this.globe) {\n // Got here before component init -> initialize globe\n this.globe = new ThreeGlobe();\n }\n const globe = this.globe;\n return globe.getGlobeRadius.apply(globe, arguments);\n },\n getCoords: function () {\n if (!this.globe) {\n // Got here before component init -> initialize globe\n this.globe = new ThreeGlobe();\n }\n const globe = this.globe;\n const returnVal = globe.getCoords.apply(globe, arguments);\n return returnVal === globe ? this // return self, not the inner globe component\n : returnVal;\n },\n toGeoCoords: function () {\n if (!this.globe) {\n // Got here before component init -> initialize globe\n this.globe = new ThreeGlobe();\n }\n const globe = this.globe;\n const returnVal = globe.toGeoCoords.apply(globe, arguments);\n return returnVal === globe ? this // return self, not the inner globe component\n : returnVal;\n },\n init: function () {\n const state = this.state = {}; // Internal state\n\n // Get camera dom element\n const cameraEl = document.querySelector('a-entity[camera], a-camera');\n\n // Keep reference to Three camera object\n state.cameraObj = cameraEl.object3D.children.filter(function (child) {\n return child.type === 'PerspectiveCamera';\n })[0];\n\n // On camera switch\n this.el.sceneEl.addEventListener('camera-set-active', function (evt) {\n // Switch camera reference\n state.cameraObj = evt.detail.cameraEl.components.camera.camera;\n });\n\n // setup Globe object\n if (!this.globe) this.globe = new ThreeGlobe(); // initialize globe if it doesn't exist yet\n\n // interaction events\n // prefer raycaster events over mouseenter/mouseleave because they expose immediately available intersection data via detail.getIntersection()\n this.el.addEventListener('raycaster-intersected', ev => state.hoverEvent = ev);\n this.el.addEventListener('raycaster-intersected-cleared', ev => state.hoverEvent = ev);\n this.el.addEventListener('click', () => state.hoverObj && this.data.onClick && this.data.onClick(formatObjForInteraction(state.hoverObj), state.hoverEvent));\n },\n remove: function () {\n // Clean-up elems\n this.el.removeObject3D('globeGroup');\n },\n update: function (oldData) {\n const comp = this;\n const elData = this.data;\n const diff = AFRAME.utils.diff(elData, oldData);\n const globeProps = ['globeImageUrl', 'bumpImageUrl', 'showGlobe', 'showGraticules', 'showAtmosphere', 'atmosphereColor', 'atmosphereAltitude', 'onGlobeReady', 'pointsData', 'pointLat', 'pointLng', 'pointColor', 'pointAltitude', 'pointRadius', 'pointResolution', 'pointsMerge', 'pointsTransitionDuration', 'arcsData', 'arcStartLat', 'arcStartLng', 'arcEndLat', 'arcEndLng', 'arcColor', 'arcAltitude', 'arcAltitudeAutoScale', 'arcStroke', 'arcCurveResolution', 'arcCircularResolution', 'arcDashLength', 'arcDashGap', 'arcDashInitialGap', 'arcDashAnimateTime', 'arcsTransitionDuration', 'polygonsData', 'polygonGeoJsonGeometry', 'polygonCapColor', 'polygonCapMaterial', 'polygonSideColor', 'polygonSideMaterial', 'polygonStrokeColor', 'polygonAltitude', 'polygonCapCurvatureResolution', 'polygonsTransitionDuration', 'pathsData', 'pathPoints', 'pathPointLat', 'pathPointLng', 'pathPointAlt', 'pathResolution', 'pathColor', 'pathStroke', 'pathDashLength', 'pathDashGap', 'pathDashInitialGap', 'pathDashAnimateTime', 'pathTransitionDuration', 'hexBinPointsData', 'hexBinPointLat', 'hexBinPointLng', 'hexBinPointWeight', 'hexBinResolution', 'hexMargin', 'hexTopCurvatureResolution', 'hexTopColor', 'hexSideColor', 'hexAltitude', 'hexBinMerge', 'hexTransitionDuration', 'hexPolygonsData', 'hexPolygonGeoJsonGeometry', 'hexPolygonColor', 'hexPolygonAltitude', 'hexPolygonResolution', 'hexPolygonMargin', 'hexPolygonCurvatureResolution', 'hexPolygonsTransitionDuration', 'tilesData', 'tileLat', 'tileLng', 'tileAltitude', 'tileWidth', 'tileHeight', 'tileUseGlobeProjection', 'tileMaterial', 'tileCurvatureResolution', 'tilesTransitionDuration', 'ringsData', 'ringLat', 'ringLng', 'ringAltitude', 'ringColor', 'ringResolution', 'ringMaxRadius', 'ringPropagationSpeed', 'ringRepeatPeriod', 'labelsData', 'labelLat', 'labelLng', 'labelAltitude', 'labelRotation', 'labelText', 'labelSize', 'labelTypeFace', 'labelColor', 'labelResolution', 'labelIncludeDot', 'labelDotRadius', 'labelDotOrientation', 'labelsTransitionDuration', 'objectsData', 'objectLat', 'objectLng', 'objectAltitude', 'objectThreeObject', 'customLayerData', 'customThreeObject', 'customThreeObjectUpdate'];\n globeProps.filter(function (p) {\n return p in diff && elData[p] !== undefined;\n }).forEach(function (p) {\n comp.globe[p](elData[p] !== '' ? elData[p] : null);\n }); // Convert blank values into nulls\n\n setTimeout(() => this.el.setObject3D('globeGroup', this.globe)); // Re-bind globe to elem\n },\n\n tick: function (t, td) {\n const state = this.state;\n const props = this.data;\n const hoverDetail = state.hoverEvent && state.hoverEvent.detail;\n\n // Update hover (intersected) object\n const intersection = hoverDetail ? hoverDetail.getIntersection ? hoverDetail.getIntersection(this.el) // available in raycaster-inters