text: (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];
  	}
  })(window, function() {
  return /******/ (function(modules) { // webpackBootstrap
  /******/ 	// The module cache
  /******/ 	var installedModules = {};
  /******/
  /******/ 	// The require function
  /******/ 	function __webpack_require__(moduleId) {
  /******/
  /******/ 		// Check if module is in cache
  /******/ 		if(installedModules[moduleId]) {
  /******/ 			return installedModules[moduleId].exports;
  /******/ 		}
  /******/ 		// Create a new module (and put it into the cache)
  /******/ 		var module = installedModules[moduleId] = {
  /******/ 			i: moduleId,
  /******/ 			l: false,
  /******/ 			exports: {}
  /******/ 		};
  /******/
  /******/ 		// Execute the module function
  /******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  /******/
  /******/ 		// Flag the module as loaded
  /******/ 		module.l = true;
  /******/
  /******/ 		// Return the exports of the module
  /******/ 		return module.exports;
  /******/ 	}
  /******/
  /******/
  /******/ 	// expose the modules object (__webpack_modules__)
  /******/ 	__webpack_require__.m = modules;
  /******/
  /******/ 	// expose the module cache
  /******/ 	__webpack_require__.c = installedModules;
  /******/
  /******/ 	// define getter function for harmony exports
  /******/ 	__webpack_require__.d = function(exports, name, getter) {
  /******/ 		if(!__webpack_require__.o(exports, name)) {
  /******/ 			Object.defineProperty(exports, name, { enumerable: true, get: getter });
  /******/ 		}
  /******/ 	};
  /******/
  /******/ 	// define __esModule on exports
  /******/ 	__webpack_require__.r = function(exports) {
  /******/ 		if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  /******/ 			Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  /******/ 		}
  /******/ 		Object.defineProperty(exports, '__esModule', { value: true });
  /******/ 	};
  /******/
  /******/ 	// create a fake namespace object
  /******/ 	// mode & 1: value is a module id, require it
  /******/ 	// mode & 2: merge all properties of value into the ns
  /******/ 	// mode & 4: return value when already ns object
  /******/ 	// mode & 8|1: behave like require
  /******/ 	__webpack_require__.t = function(value, mode) {
  /******/ 		if(mode & 1) value = __webpack_require__(value);
  /******/ 		if(mode & 8) return value;
  /******/ 		if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
  /******/ 		var ns = Object.create(null);
  /******/ 		__webpack_require__.r(ns);
  /******/ 		Object.defineProperty(ns, 'default', { enumerable: true, value: value });
  /******/ 		if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
  /******/ 		return ns;
  /******/ 	};
  /******/
  /******/ 	// getDefaultExport function for compatibility with non-harmony modules
  /******/ 	__webpack_require__.n = function(module) {
  /******/ 		var getter = module && module.__esModule ?
  /******/ 			function getDefault() { return module['default']; } :
  /******/ 			function getModuleExports() { return module; };
  /******/ 		__webpack_require__.d(getter, 'a', getter);
  /******/ 		return getter;
  /******/ 	};
  /******/
  /******/ 	// Object.prototype.hasOwnProperty.call
  /******/ 	__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  /******/
  /******/ 	// __webpack_public_path__
  /******/ 	__webpack_require__.p = "";
  /******/
  /******/
  /******/ 	// Load entry module and return exports
  /******/ 	return __webpack_require__(__webpack_require__.s = "./src/bundle.js");
  /******/ })
  /************************************************************************/
  /******/ ({
  
  /***/ "../../node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js":
  /*!***********************************************************************************************!*\
    !*** /Users/xintong/dev/loaders.gl/node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js ***!
    \***********************************************************************************************/
  /*! exports provided: default */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _arrayWithHoles; });
  function _arrayWithHoles(arr) {
    if (Array.isArray(arr)) return arr;
  }
  
  /***/ }),
  
  /***/ "../../node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js":
  /*!**************************************************************************************************!*\
    !*** /Users/xintong/dev/loaders.gl/node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js ***!
    \**************************************************************************************************/
  /*! exports provided: default */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _arrayWithoutHoles; });
  function _arrayWithoutHoles(arr) {
    if (Array.isArray(arr)) {
      for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) {
        arr2[i] = arr[i];
      }
  
      return arr2;
    }
  }
  
  /***/ }),
  
  /***/ "../../node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js":
  /*!******************************************************************************************************!*\
    !*** /Users/xintong/dev/loaders.gl/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js ***!
    \******************************************************************************************************/
  /*! exports provided: default */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _assertThisInitialized; });
  function _assertThisInitialized(self) {
    if (self === void 0) {
      throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
    }
  
    return self;
  }
  
  /***/ }),
  
  /***/ "../../node_modules/@babel/runtime/helpers/esm/classCallCheck.js":
  /*!***********************************************************************************************!*\
    !*** /Users/xintong/dev/loaders.gl/node_modules/@babel/runtime/helpers/esm/classCallCheck.js ***!
    \***********************************************************************************************/
  /*! exports provided: default */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _classCallCheck; });
  function _classCallCheck(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  
  /***/ }),
  
  /***/ "../../node_modules/@babel/runtime/helpers/esm/construct.js":
  /*!******************************************************************************************!*\
    !*** /Users/xintong/dev/loaders.gl/node_modules/@babel/runtime/helpers/esm/construct.js ***!
    \******************************************************************************************/
  /*! exports provided: default */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _construct; });
  /* harmony import */ var _setPrototypeOf__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./setPrototypeOf */ "../../node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js");
  
  
  function isNativeReflectConstruct() {
    if (typeof Reflect === "undefined" || !Reflect.construct) return false;
    if (Reflect.construct.sham) return false;
    if (typeof Proxy === "function") return true;
  
    try {
      Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));
      return true;
    } catch (e) {
      return false;
    }
  }
  
  function _construct(Parent, args, Class) {
    if (isNativeReflectConstruct()) {
      _construct = Reflect.construct;
    } else {
      _construct = function _construct(Parent, args, Class) {
        var a = [null];
        a.push.apply(a, args);
        var Constructor = Function.bind.apply(Parent, a);
        var instance = new Constructor();
        if (Class) Object(_setPrototypeOf__WEBPACK_IMPORTED_MODULE_0__["default"])(instance, Class.prototype);
        return instance;
      };
    }
  
    return _construct.apply(null, arguments);
  }
  
  /***/ }),
  
  /***/ "../../node_modules/@babel/runtime/helpers/esm/createClass.js":
  /*!********************************************************************************************!*\
    !*** /Users/xintong/dev/loaders.gl/node_modules/@babel/runtime/helpers/esm/createClass.js ***!
    \********************************************************************************************/
  /*! exports provided: default */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _createClass; });
  function _defineProperties(target, props) {
    for (var i = 0; i < props.length; i++) {
      var descriptor = props[i];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor) descriptor.writable = true;
      Object.defineProperty(target, descriptor.key, descriptor);
    }
  }
  
  function _createClass(Constructor, protoProps, staticProps) {
    if (protoProps) _defineProperties(Constructor.prototype, protoProps);
    if (staticProps) _defineProperties(Constructor, staticProps);
    return Constructor;
  }
  
  /***/ }),
  
  /***/ "../../node_modules/@babel/runtime/helpers/esm/defineProperty.js":
  /*!***********************************************************************************************!*\
    !*** /Users/xintong/dev/loaders.gl/node_modules/@babel/runtime/helpers/esm/defineProperty.js ***!
    \***********************************************************************************************/
  /*! exports provided: default */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _defineProperty; });
  function _defineProperty(obj, key, value) {
    if (key in obj) {
      Object.defineProperty(obj, key, {
        value: value,
        enumerable: true,
        configurable: true,
        writable: true
      });
    } else {
      obj[key] = value;
    }
  
    return obj;
  }
  
  /***/ }),
  
  /***/ "../../node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js":
  /*!***********************************************************************************************!*\
    !*** /Users/xintong/dev/loaders.gl/node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js ***!
    \***********************************************************************************************/
  /*! exports provided: default */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _getPrototypeOf; });
  function _getPrototypeOf(o) {
    _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
      return o.__proto__ || Object.getPrototypeOf(o);
    };
    return _getPrototypeOf(o);
  }
  
  /***/ }),
  
  /***/ "../../node_modules/@babel/runtime/helpers/esm/inherits.js":
  /*!*****************************************************************************************!*\
    !*** /Users/xintong/dev/loaders.gl/node_modules/@babel/runtime/helpers/esm/inherits.js ***!
    \*****************************************************************************************/
  /*! exports provided: default */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _inherits; });
  /* harmony import */ var _setPrototypeOf__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./setPrototypeOf */ "../../node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js");
  
  function _inherits(subClass, superClass) {
    if (typeof superClass !== "function" && superClass !== null) {
      throw new TypeError("Super expression must either be null or a function");
    }
  
    subClass.prototype = Object.create(superClass && superClass.prototype, {
      constructor: {
        value: subClass,
        writable: true,
        configurable: true
      }
    });
    if (superClass) Object(_setPrototypeOf__WEBPACK_IMPORTED_MODULE_0__["default"])(subClass, superClass);
  }
  
  /***/ }),
  
  /***/ "../../node_modules/@babel/runtime/helpers/esm/isNativeFunction.js":
  /*!*************************************************************************************************!*\
    !*** /Users/xintong/dev/loaders.gl/node_modules/@babel/runtime/helpers/esm/isNativeFunction.js ***!
    \*************************************************************************************************/
  /*! exports provided: default */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _isNativeFunction; });
  function _isNativeFunction(fn) {
    return Function.toString.call(fn).indexOf("[native code]") !== -1;
  }
  
  /***/ }),
  
  /***/ "../../node_modules/@babel/runtime/helpers/esm/iterableToArray.js":
  /*!************************************************************************************************!*\
    !*** /Users/xintong/dev/loaders.gl/node_modules/@babel/runtime/helpers/esm/iterableToArray.js ***!
    \************************************************************************************************/
  /*! exports provided: default */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _iterableToArray; });
  function _iterableToArray(iter) {
    if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter);
  }
  
  /***/ }),
  
  /***/ "../../node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js":
  /*!*****************************************************************************************************!*\
    !*** /Users/xintong/dev/loaders.gl/node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js ***!
    \*****************************************************************************************************/
  /*! exports provided: default */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _iterableToArrayLimit; });
  function _iterableToArrayLimit(arr, i) {
    if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) {
      return;
    }
  
    var _arr = [];
    var _n = true;
    var _d = false;
    var _e = undefined;
  
    try {
      for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
        _arr.push(_s.value);
  
        if (i && _arr.length === i) break;
      }
    } catch (err) {
      _d = true;
      _e = err;
    } finally {
      try {
        if (!_n && _i["return"] != null) _i["return"]();
      } finally {
        if (_d) throw _e;
      }
    }
  
    return _arr;
  }
  
  /***/ }),
  
  /***/ "../../node_modules/@babel/runtime/helpers/esm/nonIterableRest.js":
  /*!************************************************************************************************!*\
    !*** /Users/xintong/dev/loaders.gl/node_modules/@babel/runtime/helpers/esm/nonIterableRest.js ***!
    \************************************************************************************************/
  /*! exports provided: default */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _nonIterableRest; });
  function _nonIterableRest() {
    throw new TypeError("Invalid attempt to destructure non-iterable instance");
  }
  
  /***/ }),
  
  /***/ "../../node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js":
  /*!**************************************************************************************************!*\
    !*** /Users/xintong/dev/loaders.gl/node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js ***!
    \**************************************************************************************************/
  /*! exports provided: default */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _nonIterableSpread; });
  function _nonIterableSpread() {
    throw new TypeError("Invalid attempt to spread non-iterable instance");
  }
  
  /***/ }),
  
  /***/ "../../node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js":
  /*!**********************************************************************************************************!*\
    !*** /Users/xintong/dev/loaders.gl/node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js ***!
    \**********************************************************************************************************/
  /*! exports provided: default */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _possibleConstructorReturn; });
  /* harmony import */ var _helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../helpers/esm/typeof */ "../../node_modules/@babel/runtime/helpers/esm/typeof.js");
  /* harmony import */ var _assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./assertThisInitialized */ "../../node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js");
  
  
  function _possibleConstructorReturn(self, call) {
    if (call && (Object(_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__["default"])(call) === "object" || typeof call === "function")) {
      return call;
    }
  
    return Object(_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__["default"])(self);
  }
  
  /***/ }),
  
  /***/ "../../node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js":
  /*!***********************************************************************************************!*\
    !*** /Users/xintong/dev/loaders.gl/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js ***!
    \***********************************************************************************************/
  /*! exports provided: default */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _setPrototypeOf; });
  function _setPrototypeOf(o, p) {
    _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
      o.__proto__ = p;
      return o;
    };
  
    return _setPrototypeOf(o, p);
  }
  
  /***/ }),
  
  /***/ "../../node_modules/@babel/runtime/helpers/esm/slicedToArray.js":
  /*!**********************************************************************************************!*\
    !*** /Users/xintong/dev/loaders.gl/node_modules/@babel/runtime/helpers/esm/slicedToArray.js ***!
    \**********************************************************************************************/
  /*! exports provided: default */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _slicedToArray; });
  /* harmony import */ var _arrayWithHoles__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./arrayWithHoles */ "../../node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js");
  /* harmony import */ var _iterableToArrayLimit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./iterableToArrayLimit */ "../../node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js");
  /* harmony import */ var _nonIterableRest__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./nonIterableRest */ "../../node_modules/@babel/runtime/helpers/esm/nonIterableRest.js");
  
  
  
  function _slicedToArray(arr, i) {
    return Object(_arrayWithHoles__WEBPACK_IMPORTED_MODULE_0__["default"])(arr) || Object(_iterableToArrayLimit__WEBPACK_IMPORTED_MODULE_1__["default"])(arr, i) || Object(_nonIterableRest__WEBPACK_IMPORTED_MODULE_2__["default"])();
  }
  
  /***/ }),
  
  /***/ "../../node_modules/@babel/runtime/helpers/esm/toConsumableArray.js":
  /*!**************************************************************************************************!*\
    !*** /Users/xintong/dev/loaders.gl/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js ***!
    \**************************************************************************************************/
  /*! exports provided: default */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _toConsumableArray; });
  /* harmony import */ var _arrayWithoutHoles__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./arrayWithoutHoles */ "../../node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js");
  /* harmony import */ var _iterableToArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./iterableToArray */ "../../node_modules/@babel/runtime/helpers/esm/iterableToArray.js");
  /* harmony import */ var _nonIterableSpread__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./nonIterableSpread */ "../../node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js");
  
  
  
  function _toConsumableArray(arr) {
    return Object(_arrayWithoutHoles__WEBPACK_IMPORTED_MODULE_0__["default"])(arr) || Object(_iterableToArray__WEBPACK_IMPORTED_MODULE_1__["default"])(arr) || Object(_nonIterableSpread__WEBPACK_IMPORTED_MODULE_2__["default"])();
  }
  
  /***/ }),
  
  /***/ "../../node_modules/@babel/runtime/helpers/esm/typeof.js":
  /*!***************************************************************************************!*\
    !*** /Users/xintong/dev/loaders.gl/node_modules/@babel/runtime/helpers/esm/typeof.js ***!
    \***************************************************************************************/
  /*! exports provided: default */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _typeof; });
  function _typeof(obj) {
    if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
      _typeof = function _typeof(obj) {
        return typeof obj;
      };
    } else {
      _typeof = function _typeof(obj) {
        return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
      };
    }
  
    return _typeof(obj);
  }
  
  /***/ }),
  
  /***/ "../../node_modules/@babel/runtime/helpers/esm/wrapNativeSuper.js":
  /*!************************************************************************************************!*\
    !*** /Users/xintong/dev/loaders.gl/node_modules/@babel/runtime/helpers/esm/wrapNativeSuper.js ***!
    \************************************************************************************************/
  /*! exports provided: default */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _wrapNativeSuper; });
  /* harmony import */ var _getPrototypeOf__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getPrototypeOf */ "../../node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js");
  /* harmony import */ var _setPrototypeOf__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./setPrototypeOf */ "../../node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js");
  /* harmony import */ var _isNativeFunction__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isNativeFunction */ "../../node_modules/@babel/runtime/helpers/esm/isNativeFunction.js");
  /* harmony import */ var _construct__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./construct */ "../../node_modules/@babel/runtime/helpers/esm/construct.js");
  
  
  
  
  function _wrapNativeSuper(Class) {
    var _cache = typeof Map === "function" ? new Map() : undefined;
  
    _wrapNativeSuper = function _wrapNativeSuper(Class) {
      if (Class === null || !Object(_isNativeFunction__WEBPACK_IMPORTED_MODULE_2__["default"])(Class)) return Class;
  
      if (typeof Class !== "function") {
        throw new TypeError("Super expression must either be null or a function");
      }
  
      if (typeof _cache !== "undefined") {
        if (_cache.has(Class)) return _cache.get(Class);
  
        _cache.set(Class, Wrapper);
      }
  
      function Wrapper() {
        return Object(_construct__WEBPACK_IMPORTED_MODULE_3__["default"])(Class, arguments, Object(_getPrototypeOf__WEBPACK_IMPORTED_MODULE_0__["default"])(this).constructor);
      }
  
      Wrapper.prototype = Object.create(Class.prototype, {
        constructor: {
          value: Wrapper,
          enumerable: false,
          writable: true,
          configurable: true
        }
      });
      return Object(_setPrototypeOf__WEBPACK_IMPORTED_MODULE_1__["default"])(Wrapper, Class);
    };
  
    return _wrapNativeSuper(Class);
  }
  
  /***/ }),
  
  /***/ "../../node_modules/@math.gl/core/dist/esm/addons/polygon.js":
  /*!*******************************************************************************************!*\
    !*** /Users/xintong/dev/loaders.gl/node_modules/@math.gl/core/dist/esm/addons/polygon.js ***!
    \*******************************************************************************************/
  /*! exports provided: default */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Polygon; });
  /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "../../node_modules/@babel/runtime/helpers/esm/classCallCheck.js");
  /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "../../node_modules/@babel/runtime/helpers/esm/createClass.js");
  /* harmony import */ var _lib_common__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../lib/common */ "../../node_modules/@math.gl/core/dist/esm/lib/common.js");
  
  
  
  
  var Polygon = function () {
    function Polygon(points) {
      Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, Polygon);
  
      this.points = points;
      this.isClosed = Object(_lib_common__WEBPACK_IMPORTED_MODULE_2__["equals"])(this.points[this.points.length - 1], this.points[0]);
      Object.freeze(this);
    }
  
    Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(Polygon, [{
      key: "getSignedArea",
      value: function getSignedArea() {
        var area = 0;
        this.forEachSegment(function (p1, p2) {
          area += (p1[0] + p2[0]) * (p1[1] - p2[1]);
        });
        return area / 2;
      }
    }, {
      key: "getArea",
      value: function getArea() {
        return Math.abs(this.getSignedArea());
      }
    }, {
      key: "getWindingDirection",
      value: function getWindingDirection() {
        return Math.sign(this.getSignedArea());
      }
    }, {
      key: "forEachSegment",
      value: function forEachSegment(visitor) {
        var length = this.points.length;
  
        for (var i = 0; i < length - 1; i++) {
          visitor(this.points[i], this.points[i + 1], i, i + 1);
        }
  
        if (!this.isClosed) {
          visitor(this.points[length - 1], this.points[0], length - 1, 0);
        }
      }
    }]);
  
    return Polygon;
  }();
  
  
  //# sourceMappingURL=polygon.js.map
  
  /***/ }),
  
  /***/ "../../node_modules/@math.gl/core/dist/esm/classes/base/math-array.js":
  /*!****************************************************************************************************!*\
    !*** /Users/xintong/dev/loaders.gl/node_modules/@math.gl/core/dist/esm/classes/base/math-array.js ***!
    \****************************************************************************************************/
  /*! exports provided: default */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return MathArray; });
  /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "../../node_modules/@babel/runtime/helpers/esm/classCallCheck.js");
  /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "../../node_modules/@babel/runtime/helpers/esm/createClass.js");
  /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "../../node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js");
  /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "../../node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js");
  /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "../../node_modules/@babel/runtime/helpers/esm/inherits.js");
  /* harmony import */ var _babel_runtime_helpers_esm_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/wrapNativeSuper */ "../../node_modules/@babel/runtime/helpers/esm/wrapNativeSuper.js");
  /* harmony import */ var _lib_common__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../lib/common */ "../../node_modules/@math.gl/core/dist/esm/lib/common.js");
  
  
  
  
  
  
  
  
  var MathArray = function (_Array) {
    Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(MathArray, _Array);
  
    function MathArray() {
      Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, MathArray);
  
      return Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(MathArray).apply(this, arguments));
    }
  
    Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(MathArray, [{
      key: "clone",
      value: function clone() {
        return new this.constructor().copy(this);
      }
    }, {
      key: "from",
      value: function from(arrayOrObject) {
        return Array.isArray(arrayOrObject) ? this.copy(arrayOrObject) : this.fromObject(arrayOrObject);
      }
    }, {
      key: "fromArray",
      value: function fromArray(array) {
        var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  
        for (var i = 0; i < this.ELEMENTS; ++i) {
          this[i] = array[i + offset];
        }
  
        return this.check();
      }
    }, {
      key: "to",
      value: function to(arrayOrObject) {
        if (arrayOrObject === this) {
          return this;
        }
  
        return Object(_lib_common__WEBPACK_IMPORTED_MODULE_6__["isArray"])(arrayOrObject) ? this.toArray(arrayOrObject) : this.toObject(arrayOrObject);
      }
    }, {
      key: "toTarget",
      value: function toTarget(target) {
        return target ? this.to(target) : this;
      }
    }, {
      key: "toArray",
      value: function toArray() {
        var array = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
        var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  
        for (var i = 0; i < this.ELEMENTS; ++i) {
          array[offset + i] = this[i];
        }
  
        return array;
      }
    }, {
      key: "toFloat32Array",
      value: function toFloat32Array() {
        return new Float32Array(this);
      }
    }, {
      key: "toString",
      value: function toString() {
        return this.formatString(_lib_common__WEBPACK_IMPORTED_MODULE_6__["config"]);
      }
    }, {
      key: "formatString",
      value: function formatString(opts) {
        var string = '';
  
        for (var i = 0; i < this.ELEMENTS; ++i) {
          string += (i > 0 ? ', ' : '') + Object(_lib_common__WEBPACK_IMPORTED_MODULE_6__["formatValue"])(this[i], opts);
        }
  
        return "".concat(opts.printTypes ? this.constructor.name : '', "[").concat(string, "]");
      }
    }, {
      key: "equals",
      value: function equals(array) {
        if (!array || this.length !== array.length) {
          return false;
        }
  
        for (var i = 0; i < this.ELEMENTS; ++i) {
          if (!Object(_lib_common__WEBPACK_IMPORTED_MODULE_6__["equals"])(this[i], array[i])) {
            return false;
          }
        }
  
        return true;
      }
    }, {
      key: "exactEquals",
      value: function exactEquals(array) {
        if (!array || this.length !== array.length) {
          return false;
        }
  
        for (var i = 0; i < this.ELEMENTS; ++i) {
          if (this[i] !== array[i]) {
            return false;
          }
        }
  
        return true;
      }
    }, {
      key: "negate",
      value: function negate() {
        for (var i = 0; i < this.ELEMENTS; ++i) {
          this[i] = -this[i];
        }
  
        return this.check();
      }
    }, {
      key: "lerp",
      value: function lerp(a, b, t) {
        if (t === undefined) {
          t = b;
          b = a;
          a = this;
        }
  
        for (var i = 0; i < this.ELEMENTS; ++i) {
          var ai = a[i];
          this[i] = ai + t * (b[i] - ai);
        }
  
        return this.check();
      }
    }, {
      key: "min",
      value: function min(vector) {
        for (var i = 0; i < this.ELEMENTS; ++i) {
          this[i] = Math.min(vector[i], this[i]);
        }
  
        return this.check();
      }
    }, {
      key: "max",
      value: function max(vector) {
        for (var i = 0; i < this.ELEMENTS; ++i) {
          this[i] = Math.max(vector[i], this[i]);
        }
  
        return this.check();
      }
    }, {
      key: "clamp",
      value: function clamp(minVector, maxVector) {
        for (var i = 0; i < this.ELEMENTS; ++i) {
          this[i] = Math.min(Math.max(this[i], minVector[i]), maxVector[i]);
        }
  
        return this.check();
      }
    }, {
      key: "add",
      value: function add() {
        for (var _len = arguments.length, vectors = new Array(_len), _key = 0; _key < _len; _key++) {
          vectors[_key] = arguments[_key];
        }
  
        for (var _i = 0, _vectors = vectors; _i < _vectors.length; _i++) {
          var vector = _vectors[_i];
  
          for (var i = 0; i < this.ELEMENTS; ++i) {
            this[i] += vector[i];
          }
        }
  
        return this.check();
      }
    }, {
      key: "subtract",
      value: function subtract() {
        for (var _len2 = arguments.length, vectors = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
          vectors[_key2] = arguments[_key2];
        }
  
        for (var _i2 = 0, _vectors2 = vectors; _i2 < _vectors2.length; _i2++) {
          var vector = _vectors2[_i2];
  
          for (var i = 0; i < this.ELEMENTS; ++i) {
            this[i] -= vector[i];
          }
        }
  
        return this.check();
      }
    }, {
      key: "scale",
      value: function scale(_scale) {
        if (Array.isArray(_scale)) {
          return this.multiply(_scale);
        }
  
        for (var i = 0; i < this.ELEMENTS; ++i) {
          this[i] *= _scale;
        }
  
        return this.check();
      }
    }, {
      key: "sub",
      value: function sub(a) {
        return this.subtract(a);
      }
    }, {
      key: "setScalar",
      value: function setScalar(a) {
        for (var i = 0; i < this.ELEMENTS; ++i) {
          this[i] = a;
        }
  
        return this.check();
      }
    }, {
      key: "addScalar",
      value: function addScalar(a) {
        for (var i = 0; i < this.ELEMENTS; ++i) {
          this[i] += a;
        }
  
        return this.check();
      }
    }, {
      key: "subScalar",
      value: function subScalar(a) {
        return this.addScalar(-a);
      }
    }, {
      key: "multiplyScalar",
      value: function multiplyScalar(scalar) {
        for (var i = 0; i < this.ELEMENTS; ++i) {
          this[i] *= scalar;
        }
  
        return this.check();
      }
    }, {
      key: "divideScalar",
      value: function divideScalar(a) {
        return this.scale(1 / a);
      }
    }, {
      key: "clampScalar",
      value: function clampScalar(min, max) {
        for (var i = 0; i < this.ELEMENTS; ++i) {
          this[i] = Math.min(Math.max(this[i], min), max);
        }
  
        return this.check();
      }
    }, {
      key: "multiplyByScalar",
      value: function multiplyByScalar(scalar) {
        return this.scale(scalar);
      }
    }, {
      key: "check",
      value: function check() {
        if (_lib_common__WEBPACK_IMPORTED_MODULE_6__["config"].debug && !this.validate(this)) {
          throw new Error("math.gl: ".concat(this.constructor.name, " some fields set to invalid numbers'"));
        }
  
        return this;
      }
    }, {
      key: "validate",
      value: function validate() {
        var valid = this.length === this.ELEMENTS;
  
        for (var i = 0; i < this.ELEMENTS; ++i) {
          valid = valid && Number.isFinite(this[i]);
        }
  
        return valid;
      }
    }, {
      key: "elements",
      get: function get() {
        return this;
      }
    }]);
  
    return MathArray;
  }(Object(_babel_runtime_helpers_esm_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_5__["default"])(Array));
  
  
  //# sourceMappingURL=math-array.js.map
  
  /***/ }),
  
  /***/ "../../node_modules/@math.gl/core/dist/esm/classes/base/matrix.js":
  /*!************************************************************************************************!*\
    !*** /Users/xintong/dev/loaders.gl/node_modules/@math.gl/core/dist/esm/classes/base/matrix.js ***!
    \************************************************************************************************/
  /*! exports provided: default */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Matrix; });
  /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "../../node_modules/@babel/runtime/helpers/esm/classCallCheck.js");
  /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "../../node_modules/@babel/runtime/helpers/esm/createClass.js");
  /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "../../node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js");
  /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "../../node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js");
  /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "../../node_modules/@babel/runtime/helpers/esm/inherits.js");
  /* harmony import */ var _math_array__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./math-array */ "../../node_modules/@math.gl/core/dist/esm/classes/base/math-array.js");
  /* harmony import */ var _lib_validators__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../lib/validators */ "../../node_modules/@math.gl/core/dist/esm/lib/validators.js");
  /* harmony import */ var _lib_common__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../lib/common */ "../../node_modules/@math.gl/core/dist/esm/lib/common.js");
  
  
  
  
  
  
  
  
  
  var Matrix = function (_MathArray) {
    Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(Matrix, _MathArray);
  
    function Matrix() {
      Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, Matrix);
  
      return Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(Matrix).apply(this, arguments));
    }
  
    Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(Matrix, [{
      key: "toString",
      value: function toString() {
        var string = '[';
  
        if (_lib_common__WEBPACK_IMPORTED_MODULE_7__["config"].printRowMajor) {
          string += 'row-major:';
  
          for (var row = 0; row < this.RANK; ++row) {
            for (var col = 0; col < this.RANK; ++col) {
              string += " ".concat(this[col * this.RANK + row]);
            }
          }
        } else {
          string += 'column-major:';
  
          for (var i = 0; i < this.ELEMENTS; ++i) {
            string += " ".concat(this[i]);
          }
        }
  
        string += ']';
        return string;
      }
    }, {
      key: "getElementIndex",
      value: function getElementIndex(row, col) {
        return col * this.RANK + row;
      }
    }, {
      key: "getElement",
      value: function getElement(row, col) {
        return this[col * this.RANK + row];
      }
    }, {
      key: "setElement",
      value: function setElement(row, col, value) {
        this[col * this.RANK + row] = Object(_lib_validators__WEBPACK_IMPORTED_MODULE_6__["checkNumber"])(value);
        return this;
      }
    }, {
      key: "getColumn",
      value: function getColumn(columnIndex) {
        var result = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : new Array(this.RANK).fill(-0);
        var firstIndex = columnIndex * this.RANK;
  
        for (var i = 0; i < this.RANK; ++i) {
          result[i] = this[firstIndex + i];
        }
  
        return result;
      }
    }, {
      key: "setColumn",
      value: function setColumn(columnIndex, columnVector) {
        var firstIndex = columnIndex * this.RANK;
  
        for (var i = 0; i < this.RANK; ++i) {
          this[firstIndex + i] = columnVector[i];
        }
  
        return this;
      }
    }]);
  
    return Matrix;
  }(_math_array__WEBPACK_IMPORTED_MODULE_5__["default"]);
  
  
  //# sourceMappingURL=matrix.js.map
  
  /***/ }),
  
  /***/ "../../node_modules/@math.gl/core/dist/esm/classes/base/vector.js":
  /*!************************************************************************************************!*\
    !*** /Users/xintong/dev/loaders.gl/node_modules/@math.gl/core/dist/esm/classes/base/vector.js ***!
    \************************************************************************************************/
  /*! exports provided: default */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Vector; });
  /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "../../node_modules/@babel/runtime/helpers/esm/classCallCheck.js");
  /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "../../node_modules/@babel/runtime/helpers/esm/createClass.js");
  /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "../../node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js");
  /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "../../node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js");
  /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "../../node_modules/@babel/runtime/helpers/esm/inherits.js");
  /* harmony import */ var _math_array__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./math-array */ "../../node_modules/@math.gl/core/dist/esm/classes/base/math-array.js");
  /* harmony import */ var _lib_validators__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../lib/validators */ "../../node_modules/@math.gl/core/dist/esm/lib/validators.js");
  /* harmony import */ var _lib_assert__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../lib/assert */ "../../node_modules/@math.gl/core/dist/esm/lib/assert.js");
  
  
  
  
  
  
  
  
  
  var Vector = function (_MathArray) {
    Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(Vector, _MathArray);
  
    function Vector() {
      Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, Vector);
  
      return Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(Vector).apply(this, arguments));
    }
  
    Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(Vector, [{
      key: "len",
      value: function len() {
        return Math.sqrt(this.lengthSquared());
      }
    }, {
      key: "magnitude",
      value: function magnitude() {
        return this.len();
      }
    }, {
      key: "lengthSquared",
      value: function lengthSquared() {
        var length = 0;
  
        for (var i = 0; i < this.ELEMENTS; ++i) {
          length += this[i] * this[i];
        }
  
        return length;
      }
    }, {
      key: "magnitudeSquared",
      value: function magnitudeSquared() {
        return this.lengthSquared();
      }
    }, {
      key: "distance",
      value: function distance(mathArray) {
        return Math.sqrt(this.distanceSquared(mathArray));
      }
    }, {
      key: "distanceSquared",
      value: function distanceSquared(mathArray) {
        var length = 0;
  
        for (var i = 0; i < this.ELEMENTS; ++i) {
          var dist = this[i] - mathArray[i];
          length += dist * dist;
        }
  
        return Object(_lib_validators__WEBPACK_IMPORTED_MODULE_6__["checkNumber"])(length);
      }
    }, {
      key: "dot",
      value: function dot(mathArray) {
        var product = 0;
  
        for (var i = 0; i < this.ELEMENTS; ++i) {
          product += this[i] * mathArray[i];
        }
  
        return Object(_lib_validators__WEBPACK_IMPORTED_MODULE_6__["checkNumber"])(product);
      }
    }, {
      key: "normalize",
      value: function normalize() {
        var length = this.magnitude();
  
        if (length !== 0) {
          for (var i = 0; i < this.ELEMENTS; ++i) {
            this[i] /= length;
          }
        }
  
        return this.check();
      }
    }, {
      key: "multiply",
      value: function multiply() {
        for (var _len = arguments.length, vectors = new Array(_len), _key = 0; _key < _len; _key++) {
          vectors[_key] = arguments[_key];
        }
  
        for (var _i = 0, _vectors = vectors; _i < _vectors.length; _i++) {
          var vector = _vectors[_i];
  
          for (var i = 0; i < this.ELEMENTS; ++i) {
            this[i] *= vector[i];
          }
        }
  
        return this.check();
      }
    }, {
      key: "divide",
      value: function divide() {
        for (var _len2 = arguments.length, vectors = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
          vectors[_key2] = arguments[_key2];
        }
  
        for (var _i2 = 0, _vectors2 = vectors; _i2 < _vectors2.length; _i2++) {
          var vector = _vectors2[_i2];
  
          for (var i = 0; i < this.ELEMENTS; ++i) {
            this[i] /= vector[i];
          }
        }
  
        return this.check();
      }
    }, {
      key: "lengthSq",
      value: function lengthSq() {
        return this.lengthSquared();
      }
    }, {
      key: "distanceTo",
      value: function distanceTo(vector) {
        return this.distance(vector);
      }
    }, {
      key: "distanceToSquared",
      value: function distanceToSquared(vector) {
        return this.distanceSquared(vector);
      }
    }, {
      key: "getComponent",
      value: function getComponent(i) {
        Object(_lib_assert__WEBPACK_IMPORTED_MODULE_7__["default"])(i >= 0 && i < this.ELEMENTS, 'index is out of range');
        return Object(_lib_validators__WEBPACK_IMPORTED_MODULE_6__["checkNumber"])(this[i]);
      }
    }, {
      key: "setComponent",
      value: function setComponent(i, value) {
        Object(_lib_assert__WEBPACK_IMPORTED_MODULE_7__["default"])(i >= 0 && i < this.ELEMENTS, 'index is out of range');
        this[i] = value;
        return this.check();
      }
    }, {
      key: "addVectors",
      value: function addVectors(a, b) {
        return this.copy(a).add(b);
      }
    }, {
      key: "subVectors",
      value: function subVectors(a, b) {
        return this.copy(a).subtract(b);
      }
    }, {
      key: "multiplyVectors",
      value: function multiplyVectors(a, b) {
        return this.copy(a).multiply(b);
      }
    }, {
      key: "addScaledVector",
      value: function addScaledVector(a, b) {
        return this.add(new this.constructor(a).multiplyScalar(b));
      }
    }, {
      key: "x",
      get: function get() {
        return this[0];
      },
      set: function set(value) {
        return this[0] = Object(_lib_validators__WEBPACK_IMPORTED_MODULE_6__["checkNumber"])(value);
      }
    }, {
      key: "y",
      get: function get() {
        return this[1];
      },
      set: function set(value) {
        return this[1] = Object(_lib_validators__WEBPACK_IMPORTED_MODULE_6__["checkNumber"])(value);
      }
    }]);
  
    return Vector;
  }(_math_array__WEBPACK_IMPORTED_MODULE_5__["default"]);
  
  
  //# sourceMappingURL=vector.js.map
  
  /***/ }),
  
  /***/ "../../node_modules/@math.gl/core/dist/esm/classes/euler.js":
  /*!******************************************************************************************!*\
    !*** /Users/xintong/dev/loaders.gl/node_modules/@math.gl/core/dist/esm/classes/euler.js ***!
    \******************************************************************************************/
  /*! exports provided: default */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Euler; });
  /* harmony import */ var _babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/slicedToArray */ "../../node_modules/@babel/runtime/helpers/esm/slicedToArray.js");
  /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "../../node_modules/@babel/runtime/helpers/esm/classCallCheck.js");
  /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "../../node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js");
  /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "../../node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js");
  /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "../../node_modules/@babel/runtime/helpers/esm/createClass.js");
  /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "../../node_modules/@babel/runtime/helpers/esm/inherits.js");
  /* harmony import */ var _base_math_array__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./base/math-array */ "../../node_modules/@math.gl/core/dist/esm/classes/base/math-array.js");
  /* harmony import */ var _lib_common__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../lib/common */ "../../node_modules/@math.gl/core/dist/esm/lib/common.js");
  /* harmony import */ var _lib_validators__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../lib/validators */ "../../node_modules/@math.gl/core/dist/esm/lib/validators.js");
  /* harmony import */ var _quaternion__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./quaternion */ "../../node_modules/@math.gl/core/dist/esm/classes/quaternion.js");
  
  
  
  
  
  
  
  
  
  
  var ERR_UNKNOWN_ORDER = 'Unknown Euler angle order';
  var ALMOST_ONE = 0.99999;
  
  function validateOrder(value) {
    return value >= 0 && value < 6;
  }
  
  function checkOrder(value) {
    if (value < 0 && value >= 6) {
      throw new Error(ERR_UNKNOWN_ORDER);
    }
  
    return value;
  }
  
  var Euler = function (_MathArray) {
    Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_5__["default"])(Euler, _MathArray);
  
    Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_4__["default"])(Euler, [{
      key: "ELEMENTS",
      get: function get() {
        return 4;
      }
    }], [{
      key: "rotationOrder",
      value: function rotationOrder(order) {
        return Euler.RotationOrders[order];
      }
    }, {
      key: "ZYX",
      get: function get() {
        return 0;
      }
    }, {
      key: "YXZ",
      get: function get() {
        return 1;
      }
    }, {
      key: "XZY",
      get: function get() {
        return 2;
      }
    }, {
      key: "ZXY",
      get: function get() {
        return 3;
      }
    }, {
      key: "YZX",
      get: function get() {
        return 4;
      }
    }, {
      key: "XYZ",
      get: function get() {
        return 5;
      }
    }, {
      key: "RollPitchYaw",
      get: function get() {
        return 0;
      }
    }, {
      key: "DefaultOrder",
      get: function get() {
        return Euler.ZYX;
      }
    }, {
      key: "RotationOrders",
      get: function get() {
        return ['ZYX', 'YXZ', 'XZY', 'ZXY', 'YZX', 'XYZ'];
      }
    }]);
  
    function Euler() {
      var _this;
  
      var x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
      var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
      var z = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
      var order = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : Euler.DefaultOrder;
  
      Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__["default"])(this, Euler);
  
      _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(Euler).call(this, -0, -0, -0, -0));
  
      if (arguments.length > 0 && Array.isArray(arguments[0])) {
        var _this2;
  
        (_this2 = _this).fromVector3.apply(_this2, arguments);
      } else {
        _this.set(x, y, z, order);
      }
  
      return _this;
    }
  
    Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_4__["default"])(Euler, [{
      key: "fromQuaternion",
      value: function fromQuaternion(quaternion) {
        var _quaternion = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__["default"])(quaternion, 4),
            x = _quaternion[0],
            y = _quaternion[1],
            z = _quaternion[2],
            w = _quaternion[3];
  
        var ysqr = y * y;
        var t0 = -2.0 * (ysqr + z * z) + 1.0;
        var t1 = +2.0 * (x * y + w * z);
        var t2 = -2.0 * (x * z - w * y);
        var t3 = +2.0 * (y * z + w * x);
        var t4 = -2.0 * (x * x + ysqr) + 1.0;
        t2 = t2 > 1.0 ? 1.0 : t2;
        t2 = t2 < -1.0 ? -1.0 : t2;
        var roll = Math.atan2(t3, t4);
        var pitch = Math.asin(t2);
        var yaw = Math.atan2(t1, t0);
        return new Euler(roll, pitch, yaw, Euler.RollPitchYaw);
      }
    }, {
      key: "copy",
      value: function copy(array) {
        this[0] = array[0];
        this[1] = array[1];
        this[2] = array[2];
        this[3] = Number.isFinite(array[3]) || this.order;
        return this.check();
      }
    }, {
      key: "set",
      value: function set() {
        var x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
        var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
        var z = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
        var order = arguments.length > 3 ? arguments[3] : undefined;
        this[0] = x;
        this[1] = y;
        this[2] = z;
        this[3] = Number.isFinite(order) ? order : this[3];
        return this.check();
      }
    }, {
      key: "validate",
      value: function validate() {
        return validateOrder(this[3]) && Number.isFinite(this[0]) && Number.isFinite(this[1]) && Number.isFinite(this[2]);
      }
    }, {
      key: "toArray",
      value: function toArray() {
        var array = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
        var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
        array[offset] = this[0];
        array[offset + 1] = this[1];
        array[offset + 2] = this[2];
        return array;
      }
    }, {
      key: "toArray4",
      value: function toArray4() {
        var array = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
        var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
        array[offset] = this[0];
        array[offset + 1] = this[1];
        array[offset + 2] = this[2];
        array[offset + 3] = this[3];
        return array;
      }
    }, {
      key: "toVector3",
      value: function toVector3() {
        var result = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [-0, -0, -0];
        result[0] = this[0];
        result[1] = this[1];
        result[2] = this[2];
        return result;
      }
    }, {
      key: "fromVector3",
      value: function fromVector3(v, order) {
        return this.set(v[0], v[1], v[2], Number.isFinite(order) ? order : this[3]);
      }
    }, {
      key: "fromArray",
      value: function fromArray(array) {
        var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
        this[0] = array[0 + offset];
        this[1] = array[1 + offset];
        this[2] = array[2 + offset];
  
        if (array[3] !== undefined) {
          this[3] = array[3];
        }
  
        return this.check();
      }
    }, {
      key: "fromRollPitchYaw",
      value: function fromRollPitchYaw(roll, pitch, yaw) {
        return this.set(roll, pitch, yaw, Euler.ZYX);
      }
    }, {
      key: "fromRotationMatrix",
      value: function fromRotationMatrix(m) {
        var order = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Euler.DefaultOrder;
  
        this._fromRotationMatrix(m, order);
  
        return this.check();
      }
    }, {
      key: "getRotationMatrix",
      value: function getRotationMatrix(m) {
        return this._getRotationMatrix(m);
      }
    }, {
      key: "getQuaternion",
      value: function getQuaternion() {
        var q = new _quaternion__WEBPACK_IMPORTED_MODULE_9__["default"]();
  
        switch (this[4]) {
          case Euler.XYZ:
            return q.rotateX(this[0]).rotateY(this[1]).rotateZ(this[2]);
  
          case Euler.YXZ:
            return q.rotateY(this[0]).rotateX(this[1]).rotateZ(this[2]);
  
          case Euler.ZXY:
            return q.rotateZ(this[0]).rotateX(this[1]).rotateY(this[2]);
  
          case Euler.ZYX:
            return q.rotateZ(this[0]).rotateY(this[1]).rotateX(this[2]);
  
          case Euler.YZX:
            return q.rotateY(this[0]).rotateZ(this[1]).rotateX(this[2]);
  
          case Euler.XZY:
            return q.rotateX(this[0]).rotateZ(this[1]).rotateY(this[2]);
  
          default:
            throw new Error(ERR_UNKNOWN_ORDER);
        }
      }
    }, {
      key: "_fromRotationMatrix",
      value: function _fromRotationMatrix(m) {
        var order = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Euler.DefaultOrder;
        var te = m.elements;
        var m11 = te[0],
            m12 = te[4],
            m13 = te[8];
        var m21 = te[1],
            m22 = te[5],
            m23 = te[9];
        var m31 = te[2],
            m32 = te[6],
            m33 = te[10];
        order = order || this[3];
  
        switch (order) {
          case Euler.XYZ:
            this[1] = Math.asin(Object(_lib_common__WEBPACK_IMPORTED_MODULE_7__["clamp"])(m13, -1, 1));
  
            if (Math.abs(m13) < ALMOST_ONE) {
              this[0] = Math.atan2(-m23, m33);
              this[2] = Math.atan2(-m12, m11);
            } else {
              this[0] = Math.atan2(m32, m22);
              this[2] = 0;
            }
  
            break;
  
          case Euler.YXZ:
            this[0] = Math.asin(-Object(_lib_common__WEBPACK_IMPORTED_MODULE_7__["clamp"])(m23, -1, 1));
  
            if (Math.abs(m23) < ALMOST_ONE) {
              this[1] = Math.atan2(m13, m33);
              this[2] = Math.atan2(m21, m22);
            } else {
              this[1] = Math.atan2(-m31, m11);
              this[2] = 0;
            }
  
            break;
  
          case Euler.ZXY:
            this[0] = Math.asin(Object(_lib_common__WEBPACK_IMPORTED_MODULE_7__["clamp"])(m32, -1, 1));
  
            if (Math.abs(m32) < ALMOST_ONE) {
              this[1] = Math.atan2(-m31, m33);
              this[2] = Math.atan2(-m12, m22);
            } else {
              this[1] = 0;
              this[2] = Math.atan2(m21, m11);
            }
  
            break;
  
          case Euler.ZYX:
            this[1] = Math.asin(-Object(_lib_common__WEBPACK_IMPORTED_MODULE_7__["clamp"])(m31, -1, 1));
  
            if (Math.abs(m31) < ALMOST_ONE) {
              this[0] = Math.atan2(m32, m33);
              this[2] = Math.atan2(m21, m11);
            } else {
              this[0] = 0;
              this[2] = Math.atan2(-m12, m22);
            }
  
            break;
  
          case Euler.YZX:
            this[2] = Math.asin(Object(_lib_common__WEBPACK_IMPORTED_MODULE_7__["clamp"])(m21, -1, 1));
  
            if (Math.abs(m21) < ALMOST_ONE) {
              this[0] = Math.atan2(-m23, m22);
              this[1] = Math.atan2(-m31, m11);
            } else {
              this[0] = 0;
              this[1] = Math.atan2(m13, m33);
            }
  
            break;
  
          case Euler.XZY:
            this[2] = Math.asin(-Object(_lib_common__WEBPACK_IMPORTED_MODULE_7__["clamp"])(m12, -1, 1));
  
            if (Math.abs(m12) < ALMOST_ONE) {
              this[0] = Math.atan2(m32, m22);
              this[1] = Math.atan2(m13, m11);
            } else {
              this[0] = Math.atan2(-m23, m33);
              this[1] = 0;
            }
  
            break;
  
          default:
            throw new Error(ERR_UNKNOWN_ORDER);
        }
  
        this[3] = order;
        return this;
      }
    }, {
      key: "_getRotationMatrix",
      value: function _getRotationMatrix(result) {
        var te = result || [-0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0];
        var x = this.x,
            y = this.y,
            z = this.z;
        var a = Math.cos(x);
        var c = Math.cos(y);
        var e = Math.cos(z);
        var b = Math.sin(x);
        var d = Math.sin(y);
        var f = Math.sin(z);
  
        switch (this[3]) {
          case Euler.XYZ:
            {
              var ae = a * e,
                  af = a * f,
                  be = b * e,
                  bf = b * f;
              te[0] = c * e;
              te[4] = -c * f;
              te[8] = d;
              te[1] = af + be * d;
              te[5] = ae - bf * d;
              te[9] = -b * c;
              te[2] = bf - ae * d;
              te[6] = be + af * d;
              te[10] = a * c;
              break;
            }
  
          case Euler.YXZ:
            {
              var ce = c * e,
                  cf = c * f,
                  de = d * e,
                  df = d * f;
              te[0] = ce + df * b;
              te[4] = de * b - cf;
              te[8] = a * d;
              te[1] = a * f;
              te[5] = a * e;
              te[9] = -b;
              te[2] = cf * b - de;
              te[6] = df + ce * b;
              te[10] = a * c;
              break;
            }
  
          case Euler.ZXY:
            {
              var _ce = c * e,
                  _cf = c * f,
                  _de = d * e,
                  _df = d * f;
  
              te[0] = _ce - _df * b;
              te[4] = -a * f;
              te[8] = _de + _cf * b;
              te[1] = _cf + _de * b;
              te[5] = a * e;
              te[9] = _df - _ce * b;
              te[2] = -a * d;
              te[6] = b;
              te[10] = a * c;
              break;
            }
  
          case Euler.ZYX:
            {
              var _ae = a * e,
                  _af = a * f,
                  _be = b * e,
                  _bf = b * f;
  
              te[0] = c * e;
              te[4] = _be * d - _af;
              te[8] = _ae * d + _bf;
              te[1] = c * f;
              te[5] = _bf * d + _ae;
              te[9] = _af * d - _be;
              te[2] = -d;
              te[6] = b * c;
              te[10] = a * c;
              break;
            }
  
          case Euler.YZX:
            {
              var ac = a * c,
                  ad = a * d,
                  bc = b * c,
                  bd = b * d;
              te[0] = c * e;
              te[4] = bd - ac * f;
              te[8] = bc * f + ad;
              te[1] = f;
              te[5] = a * e;
              te[9] = -b * e;
              te[2] = -d * e;
              te[6] = ad * f + bc;
              te[10] = ac - bd * f;
              break;
            }
  
          case Euler.XZY:
            {
              var _ac = a * c,
                  _ad = a * d,
                  _bc = b * c,
                  _bd = b * d;
  
              te[0] = c * e;
              te[4] = -f;
              te[8] = d * e;
              te[1] = _ac * f + _bd;
              te[5] = a * e;
              te[9] = _ad * f - _bc;
              te[2] = _bc * f - _ad;
              te[6] = b * e;
              te[10] = _bd * f + _ac;
              break;
            }
  
          default:
            throw new Error(ERR_UNKNOWN_ORDER);
        }
  
        te[3] = 0;
        te[7] = 0;
        te[11] = 0;
        te[12] = 0;
        te[13] = 0;
        te[14] = 0;
        te[15] = 1;
        return te;
      }
    }, {
      key: "toQuaternion",
      value: function toQuaternion() {
        var cy = Math.cos(this.yaw * 0.5);
        var sy = Math.sin(this.yaw * 0.5);
        var cr = Math.cos(this.roll * 0.5);
        var sr = Math.sin(this.roll * 0.5);
        var cp = Math.cos(this.pitch * 0.5);
        var sp = Math.sin(this.pitch * 0.5);
        var w = cy * cr * cp + sy * sr * sp;
        var x = cy * sr * cp - sy * cr * sp;
        var y = cy * cr * sp + sy * sr * cp;
        var z = sy * cr * cp - cy * sr * sp;
        return new _quaternion__WEBPACK_IMPORTED_MODULE_9__["default"](x, y, z, w);
      }
    }, {
      key: "x",
      get: function get() {
        return this[0];
      },
      set: function set(value) {
        return this[0] = Object(_lib_validators__WEBPACK_IMPORTED_MODULE_8__["checkNumber"])(value);
      }
    }, {
      key: "y",
      get: function get() {
        return this[1];
      },
      set: function set(value) {
        return this[1] = Object(_lib_validators__WEBPACK_IMPORTED_MODULE_8__["checkNumber"])(value);
      }
    }, {
      key: "z",
      get: function get() {
        return this[2];
      },
      set: function set(value) {
        return this[2] = Object(_lib_validators__WEBPACK_IMPORTED_MODULE_8__["checkNumber"])(value);
      }
    }, {
      key: "alpha",
      get: function get() {
        return this[0];
      },
      set: function set(value) {
        return this[0] = Object(_lib_validators__WEBPACK_IMPORTED_MODULE_8__["checkNumber"])(value);
      }
    }, {
      key: "beta",
      get: function get() {
        return this[1];
      },
      set: function set(value) {
        return this[1] = Object(_lib_validators__WEBPACK_IMPORTED_MODULE_8__["checkNumber"])(value);
      }
    }, {
      key: "gamma",
      get: function get() {
        return this[2];
      },
      set: function set(value) {
        return this[2] = Object(_lib_validators__WEBPACK_IMPORTED_MODULE_8__["checkNumber"])(value);
      }
    }, {
      key: "phi",
      get: function get() {
        return this[0];
      },
      set: function set(value) {
        return this[0] = Object(_lib_validators__WEBPACK_IMPORTED_MODULE_8__["checkNumber"])(value);
      }
    }, {
      key: "theta",
      get: function get() {
        return this[1];
      },
      set: function set(value) {
        return this[1] = Object(_lib_validators__WEBPACK_IMPORTED_MODULE_8__["checkNumber"])(value);
      }
    }, {
      key: "psi",
      get: function get() {
        return this[2];
      },
      set: function set(value) {
        return this[2] = Object(_lib_validators__WEBPACK_IMPORTED_MODULE_8__["checkNumber"])(value);
      }
    }, {
      key: "roll",
      get: function get() {
        return this[0];
      },
      set: function set(value) {
        return this[0] = Object(_lib_validators__WEBPACK_IMPORTED_MODULE_8__["checkNumber"])(value);
      }
    }, {
      key: "pitch",
      get: function get() {
        return this[1];
      },
      set: function set(value) {
        return this[1] = Object(_lib_validators__WEBPACK_IMPORTED_MODULE_8__["checkNumber"])(value);
      }
    }, {
      key: "yaw",
      get: function get() {
        return this[2];
      },
      set: function set(value) {
        return this[2] = Object(_lib_validators__WEBPACK_IMPORTED_MODULE_8__["checkNumber"])(value);
      }
    }, {
      key: "order",
      get: function get() {
        return this[3];
      },
      set: function set(value) {
        return this[3] = checkOrder(value);
      }
    }]);
  
    return Euler;
  }(_base_math_array__WEBPACK_IMPORTED_MODULE_6__["default"]);
  
  
  //# sourceMappingURL=euler.js.map
  
  /***/ }),
  
  /***/ "../../node_modules/@math.gl/core/dist/esm/classes/matrix3.js":
  /*!********************************************************************************************!*\
    !*** /Users/xintong/dev/loaders.gl/node_modules/@math.gl/core/dist/esm/classes/matrix3.js ***!
    \********************************************************************************************/
  /*! exports provided: default */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Matrix3; });
  /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "../../node_modules/@babel/runtime/helpers/esm/classCallCheck.js");
  /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "../../node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js");
  /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "../../node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js");
  /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "../../node_modules/@babel/runtime/helpers/esm/createClass.js");
  /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "../../node_modules/@babel/runtime/helpers/esm/inherits.js");
  /* harmony import */ var _base_matrix__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./base/matrix */ "../../node_modules/@math.gl/core/dist/esm/classes/base/matrix.js");
  /* harmony import */ var _lib_validators__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../lib/validators */ "../../node_modules/@math.gl/core/dist/esm/lib/validators.js");
  /* harmony import */ var _lib_gl_matrix_extras__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../lib/gl-matrix-extras */ "../../node_modules/@math.gl/core/dist/esm/lib/gl-matrix-extras.js");
  /* harmony import */ var gl_matrix_mat3__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! gl-matrix/mat3 */ "../../node_modules/gl-matrix/esm/mat3.js");
  /* harmony import */ var gl_matrix_vec2__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! gl-matrix/vec2 */ "../../node_modules/gl-matrix/esm/vec2.js");
  /* harmony import */ var gl_matrix_vec3__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! gl-matrix/vec3 */ "../../node_modules/gl-matrix/esm/vec3.js");
  
  
  
  
  
  
  
  
  
  
  
  var IDENTITY = Object.freeze([1, 0, 0, 0, 1, 0, 0, 0, 1]);
  var ZERO = Object.freeze([0, 0, 0, 0, 0, 0, 0, 0, 0]);
  var INDICES = Object.freeze({
    COL0ROW0: 0,
    COL0ROW1: 1,
    COL0ROW2: 2,
    COL1ROW0: 3,
    COL1ROW1: 4,
    COL1ROW2: 5,
    COL2ROW0: 6,
    COL2ROW1: 7,
    COL2ROW2: 8
  });
  var constants = {};
  
  var Matrix3 = function (_Matrix) {
    Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(Matrix3, _Matrix);
  
    Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_3__["default"])(Matrix3, [{
      key: "ELEMENTS",
      get: function get() {
        return 9;
      }
    }, {
      key: "RANK",
      get: function get() {
        return 3;
      }
    }, {
      key: "INDICES",
      get: function get() {
        return INDICES;
      }
    }], [{
      key: "IDENTITY",
      get: function get() {
        constants.IDENTITY = constants.IDENTITY || Object.freeze(new Matrix3(IDENTITY));
        return constants.IDENTITY;
      }
    }, {
      key: "ZERO",
      get: function get() {
        constants.ZERO = constants.ZERO || Object.freeze(new Matrix3(ZERO));
        return constants.ZERO;
      }
    }]);
  
    function Matrix3(array) {
      var _this;
  
      Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, Matrix3);
  
      _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_1__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_2__["default"])(Matrix3).call(this, -0, -0, -0, -0, -0, -0, -0, -0, -0));
  
      if (arguments.length === 1 && Array.isArray(array)) {
        _this.copy(array);
      } else {
        _this.identity();
      }
  
      return _this;
    }
  
    Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_3__["default"])(Matrix3, [{
      key: "copy",
      value: function copy(array) {
        this[0] = array[0];
        this[1] = array[1];
        this[2] = array[2];
        this[3] = array[3];
        this[4] = array[4];
        this[5] = array[5];
        this[6] = array[6];
        this[7] = array[7];
        this[8] = array[8];
        return this.check();
      }
    }, {
      key: "set",
      value: function set(m00, m10, m20, m01, m11, m21, m02, m12, m22) {
        this[0] = m00;
        this[1] = m10;
        this[2] = m20;
        this[3] = m01;
        this[4] = m11;
        this[5] = m21;
        this[6] = m02;
        this[7] = m12;
        this[8] = m22;
        return this.check();
      }
    }, {
      key: "setRowMajor",
      value: function setRowMajor(m00, m01, m02, m10, m11, m12, m20, m21, m22) {
        this[0] = m00;
        this[1] = m10;
        this[2] = m20;
        this[3] = m01;
        this[4] = m11;
        this[5] = m21;
        this[6] = m02;
        this[7] = m12;
        this[8] = m22;
        return this.check();
      }
    }, {
      key: "determinant",
      value: function determinant() {
        return gl_matrix_mat3__WEBPACK_IMPORTED_MODULE_8__["determinant"](this);
      }
    }, {
      key: "identity",
      value: function identity() {
        return this.copy(IDENTITY);
      }
    }, {
      key: "fromQuaternion",
      value: function fromQuaternion(q) {
        gl_matrix_mat3__WEBPACK_IMPORTED_MODULE_8__["fromQuat"](this, q);
        return this.check();
      }
    }, {
      key: "transpose",
      value: function transpose() {
        gl_matrix_mat3__WEBPACK_IMPORTED_MODULE_8__["transpose"](this, this);
        return this.check();
      }
    }, {
      key: "invert",
      value: function invert() {
        gl_matrix_mat3__WEBPACK_IMPORTED_MODULE_8__["invert"](this, this);
        return this.check();
      }
    }, {
      key: "multiplyLeft",
      value: function multiplyLeft(a) {
        gl_matrix_mat3__WEBPACK_IMPORTED_MODULE_8__["multiply"](this, a, this);
        return this.check();
      }
    }, {
      key: "multiplyRight",
      value: function multiplyRight(a) {
        gl_matrix_mat3__WEBPACK_IMPORTED_MODULE_8__["multiply"](this, this, a);
        return this.check();
      }
    }, {
      key: "rotate",
      value: function rotate(radians) {
        gl_matrix_mat3__WEBPACK_IMPORTED_MODULE_8__["rotate"](this, this, radians);
        return this.check();
      }
    }, {
      key: "scale",
      value: function scale(factor) {
        if (Array.isArray(factor)) {
          gl_matrix_mat3__WEBPACK_IMPORTED_MODULE_8__["scale"](this, this, factor);
        } else {
          gl_matrix_mat3__WEBPACK_IMPORTED_MODULE_8__["scale"](this, this, [factor, factor, factor]);
        }
  
        return this.check();
      }
    }, {
      key: "translate",
      value: function translate(vec) {
        gl_matrix_mat3__WEBPACK_IMPORTED_MODULE_8__["translate"](this, this, vec);
        return this.check();
      }
    }, {
      key: "transform",
      value: function transform(vector, result) {
        switch (vector.length) {
          case 2:
            result = gl_matrix_vec2__WEBPACK_IMPORTED_MODULE_9__["transformMat3"](result || [-0, -0], vector, this);
            break;
  
          case 3:
            result = gl_matrix_vec3__WEBPACK_IMPORTED_MODULE_10__["transformMat3"](result || [-0, -0, -0], vector, this);
            break;
  
          case 4:
            result = Object(_lib_gl_matrix_extras__WEBPACK_IMPORTED_MODULE_7__["vec4_transformMat3"])(result || [-0, -0, -0, -0], vector, this);
            break;
  
          default:
            throw new Error('Illegal vector');
        }
  
        Object(_lib_validators__WEBPACK_IMPORTED_MODULE_6__["checkVector"])(result, vector.length);
        return result;
      }
    }, {
      key: "transformVector",
      value: function transformVector(vector, result) {
        Object(_lib_validators__WEBPACK_IMPORTED_MODULE_6__["deprecated"])('Matrix3.transformVector');
        return this.transform(vector, result);
      }
    }, {
      key: "transformVector2",
      value: function transformVector2(vector, result) {
        Object(_lib_validators__WEBPACK_IMPORTED_MODULE_6__["deprecated"])('Matrix3.transformVector');
        return this.transform(vector, result);
      }
    }, {
      key: "transformVector3",
      value: function transformVector3(vector, result) {
        Object(_lib_validators__WEBPACK_IMPORTED_MODULE_6__["deprecated"])('Matrix3.transformVector');
        return this.transform(vector, result);
      }
    }]);
  
    return Matrix3;
  }(_base_matrix__WEBPACK_IMPORTED_MODULE_5__["default"]);
  
  
  //# sourceMappingURL=matrix3.js.map
  
  /***/ }),
  
  /***/ "../../node_modules/@math.gl/core/dist/esm/classes/matrix4.js":
  /*!********************************************************************************************!*\
    !*** /Users/xintong/dev/loaders.gl/node_modules/@math.gl/core/dist/esm/classes/matrix4.js ***!
    \********************************************************************************************/
  /*! exports provided: default */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Matrix4; });
  /* harmony import */ var _babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/slicedToArray */ "../../node_modules/@babel/runtime/helpers/esm/slicedToArray.js");
  /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "../../node_modules/@babel/runtime/helpers/esm/classCallCheck.js");
  /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "../../node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js");
  /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "../../node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js");
  /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "../../node_modules/@babel/runtime/helpers/esm/createClass.js");
  /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "../../node_modules/@babel/runtime/helpers/esm/inherits.js");
  /* harmony import */ var _lib_validators__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../lib/validators */ "../../node_modules/@math.gl/core/dist/esm/lib/validators.js");
  /* harmony import */ var _base_matrix__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./base/matrix */ "../../node_modules/@math.gl/core/dist/esm/classes/base/matrix.js");
  /* harmony import */ var _lib_gl_matrix_extras__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../lib/gl-matrix-extras */ "../../node_modules/@math.gl/core/dist/esm/lib/gl-matrix-extras.js");
  /* harmony import */ var gl_matrix_mat4__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! gl-matrix/mat4 */ "../../node_modules/gl-matrix/esm/mat4.js");
  /* harmony import */ var gl_matrix_vec2__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! gl-matrix/vec2 */ "../../node_modules/gl-matrix/esm/vec2.js");
  /* harmony import */ var gl_matrix_vec3__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! gl-matrix/vec3 */ "../../node_modules/gl-matrix/esm/vec3.js");
  /* harmony import */ var gl_matrix_vec4__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! gl-matrix/vec4 */ "../../node_modules/gl-matrix/esm/vec4.js");
  
  
  
  
  
  
  
  
  
  
  
  
  
  var IDENTITY = Object.freeze([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]);
  var ZERO = Object.freeze([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
  var INDICES = Object.freeze({
    COL0ROW0: 0,
    COL0ROW1: 1,
    COL0ROW2: 2,
    COL0ROW3: 3,
    COL1ROW0: 4,
    COL1ROW1: 5,
    COL1ROW2: 6,
    COL1ROW3: 7,
    COL2ROW0: 8,
    COL2ROW1: 9,
    COL2ROW2: 10,
    COL2ROW3: 11,
    COL3ROW0: 12,
    COL3ROW1: 13,
    COL3ROW2: 14,
    COL3ROW3: 15
  });
  var constants = {};
  
  var Matrix4 = function (_Matrix) {
    Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_5__["default"])(Matrix4, _Matrix);
  
    Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_4__["default"])(Matrix4, [{
      key: "INDICES",
      get: function get() {
        return INDICES;
      }
    }, {
      key: "ELEMENTS",
      get: function get() {
        return 16;
      }
    }, {
      key: "RANK",
      get: function get() {
        return 4;
      }
    }], [{
      key: "IDENTITY",
      get: function get() {
        constants.IDENTITY = constants.IDENTITY || Object.freeze(new Matrix4(IDENTITY));
        return constants.IDENTITY;
      }
    }, {
      key: "ZERO",
      get: function get() {
        constants.ZERO = constants.ZERO || Object.freeze(new Matrix4(ZERO));
        return constants.ZERO;
      }
    }]);
  
    function Matrix4(array) {
      var _this;
  
      Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__["default"])(this, Matrix4);
  
      _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(Matrix4).call(this, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0));
  
      if (arguments.length === 1 && Array.isArray(array)) {
        _this.copy(array);
      } else {
        _this.identity();
      }
  
      return _this;
    }
  
    Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_4__["default"])(Matrix4, [{
      key: "copy",
      value: function copy(array) {
        this[0] = array[0];
        this[1] = array[1];
        this[2] = array[2];
        this[3] = array[3];
        this[4] = array[4];
        this[5] = array[5];
        this[6] = array[6];
        this[7] = array[7];
        this[8] = array[8];
        this[9] = array[9];
        this[10] = array[10];
        this[11] = array[11];
        this[12] = array[12];
        this[13] = array[13];
        this[14] = array[14];
        this[15] = array[15];
        return this.check();
      }
    }, {
      key: "set",
      value: function set(m00, m10, m20, m30, m01, m11, m21, m31, m02, m12, m22, m32, m03, m13, m23, m33) {
        this[0] = m00;
        this[1] = m10;
        this[2] = m20;
        this[3] = m30;
        this[4] = m01;
        this[5] = m11;
        this[6] = m21;
        this[7] = m31;
        this[8] = m02;
        this[9] = m12;
        this[10] = m22;
        this[11] = m32;
        this[12] = m03;
        this[13] = m13;
        this[14] = m23;
        this[15] = m33;
        return this.check();
      }
    }, {
      key: "setRowMajor",
      value: function setRowMajor(m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) {
        this[0] = m00;
        this[1] = m10;
        this[2] = m20;
        this[3] = m30;
        this[4] = m01;
        this[5] = m11;
        this[6] = m21;
        this[7] = m31;
        this[8] = m02;
        this[9] = m12;
        this[10] = m22;
        this[11] = m32;
        this[12] = m03;
        this[13] = m13;
        this[14] = m23;
        this[15] = m33;
        return this.check();
      }
    }, {
      key: "toRowMajor",
      value: function toRowMajor(result) {
        result[0] = this[0];
        result[1] = this[4];
        result[2] = this[8];
        result[3] = this[12];
        result[4] = this[1];
        result[5] = this[5];
        result[6] = this[9];
        result[7] = this[13];
        result[8] = this[2];
        result[9] = this[6];
        result[10] = this[10];
        result[11] = this[14];
        result[12] = this[3];
        result[13] = this[7];
        result[14] = this[11];
        result[15] = this[15];
        return result;
      }
    }, {
      key: "identity",
      value: function identity() {
        return this.copy(IDENTITY);
      }
    }, {
      key: "fromQuaternion",
      value: function fromQuaternion(q) {
        gl_matrix_mat4__WEBPACK_IMPORTED_MODULE_9__["fromQuat"](this, q);
        return this.check();
      }
    }, {
      key: "frustum",
      value: function frustum(_ref) {
        var left = _ref.left,
            right = _ref.right,
            bottom = _ref.bottom,
            top = _ref.top,
            near = _ref.near,
            far = _ref.far;
  
        if (far === Infinity) {
          Matrix4._computeInfinitePerspectiveOffCenter(this, left, right, bottom, top, near);
        } else {
          gl_matrix_mat4__WEBPACK_IMPORTED_MODULE_9__["frustum"](this, left, right, bottom, top, near, far);
        }
  
        return this.check();
      }
    }, {
      key: "lookAt",
      value: function lookAt(eye, center, up) {
        if (arguments.length === 1) {
          var _eye = eye;
          eye = _eye.eye;
          center = _eye.center;
          up = _eye.up;
        }
  
        center = center || [0, 0, 0];
        up = up || [0, 1, 0];
        gl_matrix_mat4__WEBPACK_IMPORTED_MODULE_9__["lookAt"](this, eye, center, up);
        return this.check();
      }
    }, {
      key: "ortho",
      value: function ortho(_ref2) {
        var left = _ref2.left,
            right = _ref2.right,
            bottom = _ref2.bottom,
            top = _ref2.top,
            _ref2$near = _ref2.near,
            near = _ref2$near === void 0 ? 0.1 : _ref2$near,
            _ref2$far = _ref2.far,
            far = _ref2$far === void 0 ? 500 : _ref2$far;
        gl_matrix_mat4__WEBPACK_IMPORTED_MODULE_9__["ortho"](this, left, right, bottom, top, near, far);
        return this.check();
      }
    }, {
      key: "orthographic",
      value: function orthographic(_ref3) {
        var _ref3$fovy = _ref3.fovy,
            fovy = _ref3$fovy === void 0 ? 45 * Math.PI / 180 : _ref3$fovy,
            _ref3$aspect = _ref3.aspect,
            aspect = _ref3$aspect === void 0 ? 1 : _ref3$aspect,
            _ref3$focalDistance = _ref3.focalDistance,
            focalDistance = _ref3$focalDistance === void 0 ? 1 : _ref3$focalDistance,
            _ref3$near = _ref3.near,
            near = _ref3$near === void 0 ? 0.1 : _ref3$near,
            _ref3$far = _ref3.far,
            far = _ref3$far === void 0 ? 500 : _ref3$far;
  
        if (fovy > Math.PI * 2) {
          throw Error('radians');
        }
  
        var halfY = fovy / 2;
        var top = focalDistance * Math.tan(halfY);
        var right = top * aspect;
        return new Matrix4().ortho({
          left: -right,
          right: right,
          bottom: -top,
          top: top,
          near: near,
          far: far
        });
      }
    }, {
      key: "perspective",
      value: function perspective() {
        var _ref4 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
            fovy = _ref4.fovy,
            _ref4$fov = _ref4.fov,
            fov = _ref4$fov === void 0 ? 45 * Math.PI / 180 : _ref4$fov,
            _ref4$aspect = _ref4.aspect,
            aspect = _ref4$aspect === void 0 ? 1 : _ref4$aspect,
            _ref4$near = _ref4.near,
            near = _ref4$near === void 0 ? 0.1 : _ref4$near,
            _ref4$far = _ref4.far,
            far = _ref4$far === void 0 ? 500 : _ref4$far;
  
        fovy = fovy || fov;
  
        if (fovy > Math.PI * 2) {
          throw Error('radians');
        }
  
        gl_matrix_mat4__WEBPACK_IMPORTED_MODULE_9__["perspective"](this, fovy, aspect, near, far);
        return this.check();
      }
    }, {
      key: "determinant",
      value: function determinant() {
        return gl_matrix_mat4__WEBPACK_IMPORTED_MODULE_9__["determinant"](this);
      }
    }, {
      key: "getScale",
      value: function getScale() {
        var result = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [-0, -0, -0];
        result[0] = Math.sqrt(this[0] * this[0] + this[1] * this[1] + this[2] * this[2]);
        result[1] = Math.sqrt(this[4] * this[4] + this[5] * this[5] + this[6] * this[6]);
        result[2] = Math.sqrt(this[8] * this[8] + this[9] * this[9] + this[10] * this[10]);
        return result;
      }
    }, {
      key: "getTranslation",
      value: function getTranslation() {
        var result = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [-0, -0, -0];
        result[0] = this[12];
        result[1] = this[13];
        result[2] = this[14];
        return result;
      }
    }, {
      key: "getRotation",
      value: function getRotation() {
        var result = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [-0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0];
        var scaleResult = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
        var scale = this.getScale(scaleResult || [-0, -0, -0]);
        var inverseScale0 = 1 / scale[0];
        var inverseScale1 = 1 / scale[1];
        var inverseScale2 = 1 / scale[2];
        result[0] = this[0] * inverseScale0;
        result[1] = this[1] * inverseScale1;
        result[2] = this[2] * inverseScale2;
        result[3] = 0;
        result[4] = this[4] * inverseScale0;
        result[5] = this[5] * inverseScale1;
        result[6] = this[6] * inverseScale2;
        result[7] = 0;
        result[8] = this[8] * inverseScale0;
        result[9] = this[9] * inverseScale1;
        result[10] = this[10] * inverseScale2;
        result[11] = 0;
        result[12] = 0;
        result[13] = 0;
        result[14] = 0;
        result[15] = 1;
        return result;
      }
    }, {
      key: "getRotationMatrix3",
      value: function getRotationMatrix3() {
        var result = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [-0, -0, -0, -0, -0, -0, -0, -0, -0];
        var scaleResult = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
        var scale = this.getScale(scaleResult || [-0, -0, -0]);
        var inverseScale0 = 1 / scale[0];
        var inverseScale1 = 1 / scale[1];
        var inverseScale2 = 1 / scale[2];
        result[0] = this[0] * inverseScale0;
        result[1] = this[1] * inverseScale1;
        result[2] = this[2] * inverseScale2;
        result[3] = this[4] * inverseScale0;
        result[4] = this[5] * inverseScale1;
        result[5] = this[6] * inverseScale2;
        result[6] = this[8] * inverseScale0;
        result[7] = this[9] * inverseScale1;
        result[8] = this[10] * inverseScale2;
        return result;
      }
    }, {
      key: "transpose",
      value: function transpose() {
        gl_matrix_mat4__WEBPACK_IMPORTED_MODULE_9__["transpose"](this, this);
        return this.check();
      }
    }, {
      key: "invert",
      value: function invert() {
        gl_matrix_mat4__WEBPACK_IMPORTED_MODULE_9__["invert"](this, this);
        return this.check();
      }
    }, {
      key: "multiplyLeft",
      value: function multiplyLeft(a) {
        gl_matrix_mat4__WEBPACK_IMPORTED_MODULE_9__["multiply"](this, a, this);
        return this.check();
      }
    }, {
      key: "multiplyRight",
      value: function multiplyRight(a) {
        gl_matrix_mat4__WEBPACK_IMPORTED_MODULE_9__["multiply"](this, this, a);
        return this.check();
      }
    }, {
      key: "rotateX",
      value: function rotateX(radians) {
        gl_matrix_mat4__WEBPACK_IMPORTED_MODULE_9__["rotateX"](this, this, radians);
        return this.check();
      }
    }, {
      key: "rotateY",
      value: function rotateY(radians) {
        gl_matrix_mat4__WEBPACK_IMPORTED_MODULE_9__["rotateY"](this, this, radians);
        return this.check();
      }
    }, {
      key: "rotateZ",
      value: function rotateZ(radians) {
        gl_matrix_mat4__WEBPACK_IMPORTED_MODULE_9__["rotateZ"](this, this, radians);
        return this.check();
      }
    }, {
      key: "rotateXYZ",
      value: function rotateXYZ(_ref5) {
        var _ref6 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__["default"])(_ref5, 3),
            rx = _ref6[0],
            ry = _ref6[1],
            rz = _ref6[2];
  
        return this.rotateX(rx).rotateY(ry).rotateZ(rz);
      }
    }, {
      key: "rotateAxis",
      value: function rotateAxis(radians, axis) {
        gl_matrix_mat4__WEBPACK_IMPORTED_MODULE_9__["rotate"](this, this, radians, axis);
        return this.check();
      }
    }, {
      key: "scale",
      value: function scale(factor) {
        if (Array.isArray(factor)) {
          gl_matrix_mat4__WEBPACK_IMPORTED_MODULE_9__["scale"](this, this, factor);
        } else {
          gl_matrix_mat4__WEBPACK_IMPORTED_MODULE_9__["scale"](this, this, [factor, factor, factor]);
        }
  
        return this.check();
      }
    }, {
      key: "translate",
      value: function translate(vec) {
        gl_matrix_mat4__WEBPACK_IMPORTED_MODULE_9__["translate"](this, this, vec);
        return this.check();
      }
    }, {
      key: "transform",
      value: function transform(vector, result) {
        if (vector.length === 4) {
          result = gl_matrix_vec4__WEBPACK_IMPORTED_MODULE_12__["transformMat4"](result || [-0, -0, -0, -0], vector, this);
          Object(_lib_validators__WEBPACK_IMPORTED_MODULE_6__["checkVector"])(result, 4);
          return result;
        }
  
        return this.transformAsPoint(vector, result);
      }
    }, {
      key: "transformAsPoint",
      value: function transformAsPoint(vector, result) {
        var length = vector.length;
  
        switch (length) {
          case 2:
            result = gl_matrix_vec2__WEBPACK_IMPORTED_MODULE_10__["transformMat4"](result || [-0, -0], vector, this);
            break;
  
          case 3:
            result = gl_matrix_vec3__WEBPACK_IMPORTED_MODULE_11__["transformMat4"](result || [-0, -0, -0], vector, this);
            break;
  
          default:
            throw new Error('Illegal vector');
        }
  
        Object(_lib_validators__WEBPACK_IMPORTED_MODULE_6__["checkVector"])(result, vector.length);
        return result;
      }
    }, {
      key: "transformAsVector",
      value: function transformAsVector(vector, result) {
        switch (vector.length) {
          case 2:
            result = Object(_lib_gl_matrix_extras__WEBPACK_IMPORTED_MODULE_8__["vec2_transformMat4AsVector"])(result || [-0, -0], vector, this);
            break;
  
          case 3:
            result = Object(_lib_gl_matrix_extras__WEBPACK_IMPORTED_MODULE_8__["vec3_transformMat4AsVector"])(result || [-0, -0, -0], vector, this);
            break;
  
          default:
            throw new Error('Illegal vector');
        }
  
        Object(_lib_validators__WEBPACK_IMPORTED_MODULE_6__["checkVector"])(result, vector.length);
        return result;
      }
    }, {
      key: "makeRotationX",
      value: function makeRotationX(radians) {
        return this.identity().rotateX(radians);
      }
    }, {
      key: "makeTranslation",
      value: function makeTranslation(x, y, z) {
        return this.identity().translate([x, y, z]);
      }
    }, {
      key: "transformPoint",
      value: function transformPoint(vector, result) {
        Object(_lib_validators__WEBPACK_IMPORTED_MODULE_6__["deprecated"])('Matrix4.transformPoint', '3.0');
        return this.transformAsPoint(vector, result);
      }
    }, {
      key: "transformVector",
      value: function transformVector(vector, result) {
        Object(_lib_validators__WEBPACK_IMPORTED_MODULE_6__["deprecated"])('Matrix4.transformVector', '3.0');
        return this.transformAsPoint(vector, result);
      }
    }, {
      key: "transformDirection",
      value: function transformDirection(vector, result) {
        Object(_lib_validators__WEBPACK_IMPORTED_MODULE_6__["deprecated"])('Matrix4.transformDirection', '3.0');
        return this.transformAsVector(vector, result);
      }
    }], [{
      key: "_computeInfinitePerspectiveOffCenter",
      value: function _computeInfinitePerspectiveOffCenter(result, left, right, bottom, top, near) {
        var column0Row0 = 2.0 * near / (right - left);
        var column1Row1 = 2.0 * near / (top - bottom);
        var column2Row0 = (right + left) / (right - left);
        var column2Row1 = (top + bottom) / (top - bottom);
        var column2Row2 = -1.0;
        var column2Row3 = -1.0;
        var column3Row2 = -2.0 * near;
        result[0] = column0Row0;
        result[1] = 0.0;
        result[2] = 0.0;
        result[3] = 0.0;
        result[4] = 0.0;
        result[5] = column1Row1;
        result[6] = 0.0;
        result[7] = 0.0;
        result[8] = column2Row0;
        result[9] = column2Row1;
        result[10] = column2Row2;
        result[11] = column2Row3;
        result[12] = 0.0;
        result[13] = 0.0;
        result[14] = column3Row2;
        result[15] = 0.0;
        return result;
      }
    }]);
  
    return Matrix4;
  }(_base_matrix__WEBPACK_IMPORTED_MODULE_7__["default"]);
  
  
  //# sourceMappingURL=matrix4.js.map
  
  /***/ }),
  
  /***/ "../../node_modules/@math.gl/core/dist/esm/classes/pose.js":
  /*!*****************************************************************************************!*\
    !*** /Users/xintong/dev/loaders.gl/node_modules/@math.gl/core/dist/esm/classes/pose.js ***!
    \*****************************************************************************************/
  /*! exports provided: default */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Pose; });
  /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "../../node_modules/@babel/runtime/helpers/esm/classCallCheck.js");
  /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "../../node_modules/@babel/runtime/helpers/esm/createClass.js");
  /* harmony import */ var _matrix4__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./matrix4 */ "../../node_modules/@math.gl/core/dist/esm/classes/matrix4.js");
  /* harmony import */ var _vector3__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./vector3 */ "../../node_modules/@math.gl/core/dist/esm/classes/vector3.js");
  /* harmony import */ var _euler__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./euler */ "../../node_modules/@math.gl/core/dist/esm/classes/euler.js");
  
  
  
  
  
  
  var Pose = function () {
    function Pose() {
      var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
          _ref$x = _ref.x,
          x = _ref$x === void 0 ? 0 : _ref$x,
          _ref$y = _ref.y,
          y = _ref$y === void 0 ? 0 : _ref$y,
          _ref$z = _ref.z,
          z = _ref$z === void 0 ? 0 : _ref$z,
          _ref$roll = _ref.roll,
          roll = _ref$roll === void 0 ? 0 : _ref$roll,
          _ref$pitch = _ref.pitch,
          pitch = _ref$pitch === void 0 ? 0 : _ref$pitch,
          _ref$yaw = _ref.yaw,
          yaw = _ref$yaw === void 0 ? 0 : _ref$yaw,
          position = _ref.position,
          orientation = _ref.orientation;
  
      Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, Pose);
  
      if (Array.isArray(position) && position.length === 3) {
        this.position = new _vector3__WEBPACK_IMPORTED_MODULE_3__["default"](position);
      } else {
        this.position = new _vector3__WEBPACK_IMPORTED_MODULE_3__["default"](x, y, z);
      }
  
      if (Array.isArray(orientation) && orientation.length === 4) {
        this.orientation = new _euler__WEBPACK_IMPORTED_MODULE_4__["default"](orientation, orientation[3]);
      } else {
        this.orientation = new _euler__WEBPACK_IMPORTED_MODULE_4__["default"](roll, pitch, yaw, _euler__WEBPACK_IMPORTED_MODULE_4__["default"].RollPitchYaw);
      }
    }
  
    Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(Pose, [{
      key: "getPosition",
      value: function getPosition() {
        return this.position;
      }
    }, {
      key: "getOrientation",
      value: function getOrientation() {
        return this.orientation;
      }
    }, {
      key: "equals",
      value: function equals(pose) {
        if (!pose) {
          return false;
        }
  
        return this.position.equals(pose.position) && this.orientation.equals(pose.orientation);
      }
    }, {
      key: "exactEquals",
      value: function exactEquals(pose) {
        if (!pose) {
          return false;
        }
  
        return this.position.exactEquals(pose.position) && this.orientation.exactEquals(pose.orientation);
      }
    }, {
      key: "getTransformationMatrix",
      value: function getTransformationMatrix() {
        var sr = Math.sin(this.roll);
        var sp = Math.sin(this.pitch);
        var sw = Math.sin(this.yaw);
        var cr = Math.cos(this.roll);
        var cp = Math.cos(this.pitch);
        var cw = Math.cos(this.yaw);
        var matrix = new _matrix4__WEBPACK_IMPORTED_MODULE_2__["default"]().setRowMajor(cw * cp, -sw * cr + cw * sp * sr, sw * sr + cw * sp * cr, this.x, sw * cp, cw * cr + sw * sp * sr, -cw * sr + sw * sp * cr, this.y, -sp, cp * sr, cp * cr, this.z, 0, 0, 0, 1);
        return matrix;
      }
    }, {
      key: "getTransformationMatrixFromPose",
      value: function getTransformationMatrixFromPose(pose) {
        return new _matrix4__WEBPACK_IMPORTED_MODULE_2__["default"]().multiplyRight(this.getTransformationMatrix()).multiplyRight(pose.getTransformationMatrix().invert());
      }
    }, {
      key: "getTransformationMatrixToPose",
      value: function getTransformationMatrixToPose(pose) {
        return new _matrix4__WEBPACK_IMPORTED_MODULE_2__["default"]().multiplyRight(pose.getTransformationMatrix()).multiplyRight(this.getTransformationMatrix().invert());
      }
    }, {
      key: "x",
      get: function get() {
        return this.position.x;
      },
      set: function set(value) {
        return this.position.x = value;
      }
    }, {
      key: "y",
      get: function get() {
        return this.position.y;
      },
      set: function set(value) {
        return this.position.y = value;
      }
    }, {
      key: "z",
      get: function get() {
        return this.position.z;
      },
      set: function set(value) {
        return this.position.z = value;
      }
    }, {
      key: "roll",
      get: function get() {
        return this.orientation.roll;
      },
      set: function set(value) {
        return this.orientation.roll = value;
      }
    }, {
      key: "pitch",
      get: function get() {
        return this.orientation.pitch;
      },
      set: function set(value) {
        return this.orientation.pitch = value;
      }
    }, {
      key: "yaw",
      get: function get() {
        return this.orientation.yaw;
      },
      set: function set(value) {
        return this.orientation.yaw = value;
      }
    }]);
  
    return Pose;
  }();
  
  
  //# sourceMappingURL=pose.js.map
  
  /***/ }),
  
  /***/ "../../node_modules/@math.gl/core/dist/esm/classes/quaternion.js":
  /*!***********************************************************************************************!*\
    !*** /Users/xintong/dev/loaders.gl/node_modules/@math.gl/core/dist/esm/classes/quaternion.js ***!
    \***********************************************************************************************/
  /*! exports provided: default */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Quaternion; });
  /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "../../node_modules/@babel/runtime/helpers/esm/classCallCheck.js");
  /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "../../node_modules/@babel/runtime/helpers/esm/createClass.js");
  /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "../../node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js");
  /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "../../node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js");
  /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "../../node_modules/@babel/runtime/helpers/esm/inherits.js");
  /* harmony import */ var _base_math_array__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./base/math-array */ "../../node_modules/@math.gl/core/dist/esm/classes/base/math-array.js");
  /* harmony import */ var _lib_validators__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../lib/validators */ "../../node_modules/@math.gl/core/dist/esm/lib/validators.js");
  /* harmony import */ var _lib_assert__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../lib/assert */ "../../node_modules/@math.gl/core/dist/esm/lib/assert.js");
  /* harmony import */ var gl_matrix_quat__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! gl-matrix/quat */ "../../node_modules/gl-matrix/esm/quat.js");
  /* harmony import */ var gl_matrix_vec4__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! gl-matrix/vec4 */ "../../node_modules/gl-matrix/esm/vec4.js");
  
  
  
  
  
  
  
  
  
  
  var IDENTITY_QUATERNION = [0, 0, 0, 1];
  
  var Quaternion = function (_MathArray) {
    Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(Quaternion, _MathArray);
  
    function Quaternion() {
      var _this;
  
      var x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
      var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
      var z = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
      var w = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
  
      Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, Quaternion);
  
      _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(Quaternion).call(this, -0, -0, -0, -0));
  
      if (Array.isArray(x) && arguments.length === 1) {
        _this.copy(x);
      } else {
        _this.set(x, y, z, w);
      }
  
      return _this;
    }
  
    Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(Quaternion, [{
      key: "copy",
      value: function copy(array) {
        this[0] = array[0];
        this[1] = array[1];
        this[2] = array[2];
        this[3] = array[3];
        return this.check();
      }
    }, {
      key: "set",
      value: function set(x, y, z, w) {
        this[0] = x;
        this[1] = y;
        this[2] = z;
        this[3] = w;
        return this.check();
      }
    }, {
      key: "fromMatrix3",
      value: function fromMatrix3(m) {
        gl_matrix_quat__WEBPACK_IMPORTED_MODULE_8__["fromMat3"](this, m);
        return this.check();
      }
    }, {
      key: "identity",
      value: function identity() {
        gl_matrix_quat__WEBPACK_IMPORTED_MODULE_8__["identity"](this);
        return this.check();
      }
    }, {
      key: "fromAxisRotation",
      value: function fromAxisRotation(axis, rad) {
        gl_matrix_quat__WEBPACK_IMPORTED_MODULE_8__["setAxisAngle"](this, axis, rad);
        return this.check();
      }
    }, {
      key: "setAxisAngle",
      value: function setAxisAngle(axis, rad) {
        return this.fromAxisRotation(axis, rad);
      }
    }, {
      key: "len",
      value: function len() {
        return gl_matrix_quat__WEBPACK_IMPORTED_MODULE_8__["length"](this);
      }
    }, {
      key: "lengthSquared",
      value: function lengthSquared(a) {
        return gl_matrix_quat__WEBPACK_IMPORTED_MODULE_8__["squaredLength"](this);
      }
    }, {
      key: "dot",
      value: function dot(a, b) {
        if (b !== undefined) {
          throw new Error('Quaternion.dot only takes one argument');
        }
  
        return gl_matrix_quat__WEBPACK_IMPORTED_MODULE_8__["dot"](this, a);
      }
    }, {
      key: "rotationTo",
      value: function rotationTo(vectorA, vectorB) {
        gl_matrix_quat__WEBPACK_IMPORTED_MODULE_8__["rotationTo"](this, vectorA, vectorB);
        return this.check();
      }
    }, {
      key: "add",
      value: function add(a, b) {
        if (b !== undefined) {
          throw new Error('Quaternion.add only takes one argument');
        }
  
        gl_matrix_quat__WEBPACK_IMPORTED_MODULE_8__["add"](this, this, a);
        return this.check();
      }
    }, {
      key: "calculateW",
      value: function calculateW() {
        gl_matrix_quat__WEBPACK_IMPORTED_MODULE_8__["calculateW"](this, this);
        return this.check();
      }
    }, {
      key: "conjugate",
      value: function conjugate() {
        gl_matrix_quat__WEBPACK_IMPORTED_MODULE_8__["conjugate"](this, this);
        return this.check();
      }
    }, {
      key: "invert",
      value: function invert() {
        gl_matrix_quat__WEBPACK_IMPORTED_MODULE_8__["invert"](this, this);
        return this.check();
      }
    }, {
      key: "lerp",
      value: function lerp(a, b, t) {
        gl_matrix_quat__WEBPACK_IMPORTED_MODULE_8__["lerp"](this, a, b, t);
        return this.check();
      }
    }, {
      key: "multiplyRight",
      value: function multiplyRight(a, b) {
        Object(_lib_assert__WEBPACK_IMPORTED_MODULE_7__["default"])(!b);
        gl_matrix_quat__WEBPACK_IMPORTED_MODULE_8__["multiply"](this, this, a);
        return this.check();
      }
    }, {
      key: "multiplyLeft",
      value: function multiplyLeft(a, b) {
        Object(_lib_assert__WEBPACK_IMPORTED_MODULE_7__["default"])(!b);
        gl_matrix_quat__WEBPACK_IMPORTED_MODULE_8__["multiply"](this, a, this);
        return this.check();
      }
    }, {
      key: "normalize",
      value: function normalize() {
        var length = this.len();
        var l = length > 0 ? 1 / length : 0;
        this[0] = this[0] * l;
        this[1] = this[1] * l;
        this[2] = this[2] * l;
        this[3] = this[3] * l;
  
        if (length === 0) {
          this[3] = 1;
        }
  
        return this.check();
      }
    }, {
      key: "rotateX",
      value: function rotateX(rad) {
        gl_matrix_quat__WEBPACK_IMPORTED_MODULE_8__["rotateX"](this, this, rad);
        return this.check();
      }
    }, {
      key: "rotateY",
      value: function rotateY(rad) {
        gl_matrix_quat__WEBPACK_IMPORTED_MODULE_8__["rotateY"](this, this, rad);
        return this.check();
      }
    }, {
      key: "rotateZ",
      value: function rotateZ(rad) {
        gl_matrix_quat__WEBPACK_IMPORTED_MODULE_8__["rotateZ"](this, this, rad);
        return this.check();
      }
    }, {
      key: "scale",
      value: function scale(b) {
        gl_matrix_quat__WEBPACK_IMPORTED_MODULE_8__["scale"](this, this, b);
        return this.check();
      }
    }, {
      key: "slerp",
      value: function slerp(start, target, ratio) {
        switch (arguments.length) {
          case 1:
            var _arguments$ = arguments[0];
            var _arguments$$start = _arguments$.start;
            start = _arguments$$start === void 0 ? IDENTITY_QUATERNION : _arguments$$start;
            target = _arguments$.target;
            ratio = _arguments$.ratio;
            break;
  
          case 2:
            var _arguments = Array.prototype.slice.call(arguments);
  
            target = _arguments[0];
            ratio = _arguments[1];
            start = this;
            break;
  
          default:
        }
  
        gl_matrix_quat__WEBPACK_IMPORTED_MODULE_8__["slerp"](this, start, target, ratio);
        return this.check();
      }
    }, {
      key: "transformVector4",
      value: function transformVector4(vector) {
        var result = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : vector;
        gl_matrix_vec4__WEBPACK_IMPORTED_MODULE_9__["transformQuat"](result, vector, this);
        return Object(_lib_validators__WEBPACK_IMPORTED_MODULE_6__["checkVector"])(result, 4);
      }
    }, {
      key: "lengthSq",
      value: function lengthSq() {
        return this.lengthSquared();
      }
    }, {
      key: "setFromAxisAngle",
      value: function setFromAxisAngle(axis, rad) {
        return this.setAxisAngle(axis, rad);
      }
    }, {
      key: "premultiply",
      value: function premultiply(a, b) {
        return this.multiplyLeft(a, b);
      }
    }, {
      key: "multiply",
      value: function multiply(a, b) {
        return this.multiplyRight(a, b);
      }
    }, {
      key: "ELEMENTS",
      get: function get() {
        return 4;
      }
    }, {
      key: "x",
      get: function get() {
        return this[0];
      },
      set: function set(value) {
        return this[0] = Object(_lib_validators__WEBPACK_IMPORTED_MODULE_6__["checkNumber"])(value);
      }
    }, {
      key: "y",
      get: function get() {
        return this[1];
      },
      set: function set(value) {
        return this[1] = Object(_lib_validators__WEBPACK_IMPORTED_MODULE_6__["checkNumber"])(value);
      }
    }, {
      key: "z",
      get: function get() {
        return this[2];
      },
      set: function set(value) {
        return this[2] = Object(_lib_validators__WEBPACK_IMPORTED_MODULE_6__["checkNumber"])(value);
      }
    }, {
      key: "w",
      get: function get() {
        return this[3];
      },
      set: function set(value) {
        return this[3] = Object(_lib_validators__WEBPACK_IMPORTED_MODULE_6__["checkNumber"])(value);
      }
    }]);
  
    return Quaternion;
  }(_base_math_array__WEBPACK_IMPORTED_MODULE_5__["default"]);
  
  
  //# sourceMappingURL=quaternion.js.map
  
  /***/ }),
  
  /***/ "../../node_modules/@math.gl/core/dist/esm/classes/spherical-coordinates.js":
  /*!**********************************************************************************************************!*\
    !*** /Users/xintong/dev/loaders.gl/node_modules/@math.gl/core/dist/esm/classes/spherical-coordinates.js ***!
    \**********************************************************************************************************/
  /*! exports provided: default */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return SphericalCoordinates; });
  /* harmony import */ var _babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/slicedToArray */ "../../node_modules/@babel/runtime/helpers/esm/slicedToArray.js");
  /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "../../node_modules/@babel/runtime/helpers/esm/classCallCheck.js");
  /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "../../node_modules/@babel/runtime/helpers/esm/createClass.js");
  /* harmony import */ var _lib_common__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../lib/common */ "../../node_modules/@math.gl/core/dist/esm/lib/common.js");
  /* harmony import */ var _vector3__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./vector3 */ "../../node_modules/@math.gl/core/dist/esm/classes/vector3.js");
  /* harmony import */ var gl_matrix_vec3__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! gl-matrix/vec3 */ "../../node_modules/gl-matrix/esm/vec3.js");
  
  
  
  
  
  
  
  var EPSILON = 0.000001;
  var EARTH_RADIUS_METERS = 6.371e6;
  
  var SphericalCoordinates = function () {
    function SphericalCoordinates() {
      var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
          phi = _ref.phi,
          theta = _ref.theta,
          radius = _ref.radius,
          bearing = _ref.bearing,
          pitch = _ref.pitch,
          altitude = _ref.altitude,
          _ref$radiusScale = _ref.radiusScale,
          radiusScale = _ref$radiusScale === void 0 ? EARTH_RADIUS_METERS : _ref$radiusScale;
  
      Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__["default"])(this, SphericalCoordinates);
  
      if (arguments.length === 0) {
        this.phi = 0;
        this.theta = 0;
        this.radius = 1;
      } else if (Number.isFinite(phi) || Number.isFinite(theta)) {
        this.phi = phi || 0;
        this.theta = theta || 0;
      } else if (Number.isFinite(bearing) || Number.isFinite(pitch)) {
        this.bearing = bearing || 0;
        this.pitch = pitch || 0;
      }
  
      this.radius = radius || 1;
      this.radiusScale = radiusScale || 1;
      this.check();
    }
  
    Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__["default"])(SphericalCoordinates, [{
      key: "toString",
      value: function toString() {
        return this.formatString(_lib_common__WEBPACK_IMPORTED_MODULE_3__["config"]);
      }
    }, {
      key: "formatString",
      value: function formatString(_ref2) {
        var printTypes = _ref2.printTypes,
            printDegrees = _ref2.printDegrees;
        var f = _lib_common__WEBPACK_IMPORTED_MODULE_3__["formatValue"];
        return "".concat(printTypes ? 'Spherical' : '', "[rho:").concat(f(this.radius), ",theta:").concat(f(this.theta), ",phi:").concat(f(this.phi), "]");
      }
    }, {
      key: "equals",
      value: function equals(other) {
        return Object(_lib_common__WEBPACK_IMPORTED_MODULE_3__["equals"])(this.radius, other.radius) && Object(_lib_common__WEBPACK_IMPORTED_MODULE_3__["equals"])(this.theta, other.theta) && Object(_lib_common__WEBPACK_IMPORTED_MODULE_3__["equals"])(this.phi, other.phi);
      }
    }, {
      key: "exactEquals",
      value: function exactEquals(other) {
        return this.radius === other.radius && this.theta === other.theta && this.phi === other.phi;
      }
    }, {
      key: "set",
      value: function set(radius, phi, theta) {
        this.radius = radius;
        this.phi = phi;
        this.theta = theta;
        return this.check();
      }
    }, {
      key: "clone",
      value: function clone() {
        return new this.constructor().copy(this);
      }
    }, {
      key: "copy",
      value: function copy(other) {
        this.radius = other.radius;
        this.phi = other.phi;
        this.theta = other.theta;
        return this.check();
      }
    }, {
      key: "fromLngLatZ",
      value: function fromLngLatZ(_ref3) {
        var _ref4 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__["default"])(_ref3, 3),
            lng = _ref4[0],
            lat = _ref4[1],
            z = _ref4[2];
  
        this.radius = 1 + z / this.radiusScale;
        this.phi = Object(_lib_common__WEBPACK_IMPORTED_MODULE_3__["radians"])(lat);
        this.theta = Object(_lib_common__WEBPACK_IMPORTED_MODULE_3__["radians"])(lng);
      }
    }, {
      key: "fromVector3",
      value: function fromVector3(v) {
        this.radius = gl_matrix_vec3__WEBPACK_IMPORTED_MODULE_5__["length"](v);
  
        if (this.radius > 0) {
          this.theta = Math.atan2(v[0], v[1]);
          this.phi = Math.acos(Object(_lib_common__WEBPACK_IMPORTED_MODULE_3__["clamp"])(v[2] / this.radius, -1, 1));
        }
  
        return this.check();
      }
    }, {
      key: "toVector3",
      value: function toVector3() {
        return new _vector3__WEBPACK_IMPORTED_MODULE_4__["default"](0, 0, this.radius).rotateX({
          radians: this.theta
        }).rotateZ({
          radians: this.phi
        });
      }
    }, {
      key: "makeSafe",
      value: function makeSafe() {
        this.phi = Math.max(EPSILON, Math.min(Math.PI - EPSILON, this.phi));
      }
    }, {
      key: "check",
      value: function check() {
        if (!Number.isFinite(this.phi) || !Number.isFinite(this.theta) || !(this.radius > 0)) {
          throw new Error('SphericalCoordinates: some fields set to invalid numbers');
        }
  
        return this;
      }
    }, {
      key: "bearing",
      get: function get() {
        return 180 - Object(_lib_common__WEBPACK_IMPORTED_MODULE_3__["degrees"])(this.phi);
      },
      set: function set(v) {
        this.phi = Math.PI - Object(_lib_common__WEBPACK_IMPORTED_MODULE_3__["radians"])(v);
      }
    }, {
      key: "pitch",
      get: function get() {
        return Object(_lib_common__WEBPACK_IMPORTED_MODULE_3__["degrees"])(this.theta);
      },
      set: function set(v) {
        this.theta = Object(_lib_common__WEBPACK_IMPORTED_MODULE_3__["radians"])(v);
      }
    }, {
      key: "longitude",
      get: function get() {
        return Object(_lib_common__WEBPACK_IMPORTED_MODULE_3__["degrees"])(this.phi);
      }
    }, {
      key: "latitude",
      get: function get() {
        return Object(_lib_common__WEBPACK_IMPORTED_MODULE_3__["degrees"])(this.theta);
      }
    }, {
      key: "lng",
      get: function get() {
        return Object(_lib_common__WEBPACK_IMPORTED_MODULE_3__["degrees"])(this.phi);
      }
    }, {
      key: "lat",
      get: function get() {
        return Object(_lib_common__WEBPACK_IMPORTED_MODULE_3__["degrees"])(this.theta);
      }
    }, {
      key: "z",
      get: function get() {
        return (this.radius - 1) * this.radiusScale;
      }
    }]);
  
    return SphericalCoordinates;
  }();
  
  
  //# sourceMappingURL=spherical-coordinates.js.map
  
  /***/ }),
  
  /***/ "../../node_modules/@math.gl/core/dist/esm/classes/vector2.js":
  /*!********************************************************************************************!*\
    !*** /Users/xintong/dev/loaders.gl/node_modules/@math.gl/core/dist/esm/classes/vector2.js ***!
    \********************************************************************************************/
  /*! exports provided: default */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Vector2; });
  /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "../../node_modules/@babel/runtime/helpers/esm/classCallCheck.js");
  /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "../../node_modules/@babel/runtime/helpers/esm/createClass.js");
  /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "../../node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js");
  /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "../../node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js");
  /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "../../node_modules/@babel/runtime/helpers/esm/inherits.js");
  /* harmony import */ var _base_vector__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./base/vector */ "../../node_modules/@math.gl/core/dist/esm/classes/base/vector.js");
  /* harmony import */ var _lib_common__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../lib/common */ "../../node_modules/@math.gl/core/dist/esm/lib/common.js");
  /* harmony import */ var _lib_validators__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../lib/validators */ "../../node_modules/@math.gl/core/dist/esm/lib/validators.js");
  /* harmony import */ var gl_matrix_vec2__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! gl-matrix/vec2 */ "../../node_modules/gl-matrix/esm/vec2.js");
  /* harmony import */ var _lib_gl_matrix_extras__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../lib/gl-matrix-extras */ "../../node_modules/@math.gl/core/dist/esm/lib/gl-matrix-extras.js");
  
  
  
  
  
  
  
  
  
  
  
  var Vector2 = function (_Vector) {
    Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(Vector2, _Vector);
  
    function Vector2() {
      var _this;
  
      var x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
      var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  
      Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, Vector2);
  
      _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(Vector2).call(this, 2));
  
      if (Object(_lib_common__WEBPACK_IMPORTED_MODULE_6__["isArray"])(x) && arguments.length === 1) {
        _this.copy(x);
      } else {
        if (_lib_common__WEBPACK_IMPORTED_MODULE_6__["config"].debug) {
          Object(_lib_validators__WEBPACK_IMPORTED_MODULE_7__["checkNumber"])(x);
          Object(_lib_validators__WEBPACK_IMPORTED_MODULE_7__["checkNumber"])(y);
        }
  
        _this[0] = x;
        _this[1] = y;
      }
  
      return _this;
    }
  
    Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(Vector2, [{
      key: "set",
      value: function set(x, y, z) {
        this[0] = x;
        this[1] = y;
        return this.check();
      }
    }, {
      key: "copy",
      value: function copy(array) {
        this[0] = array[0];
        this[1] = array[1];
        return this.check();
      }
    }, {
      key: "fromObject",
      value: function fromObject(object) {
        if (_lib_common__WEBPACK_IMPORTED_MODULE_6__["config"].debug) {
          Object(_lib_validators__WEBPACK_IMPORTED_MODULE_7__["checkNumber"])(object.x);
          Object(_lib_validators__WEBPACK_IMPORTED_MODULE_7__["checkNumber"])(object.y);
        }
  
        this[0] = object.x;
        this[1] = object.y;
        return this.check();
      }
    }, {
      key: "toObject",
      value: function toObject(object) {
        object.x = this[0];
        object.y = this[1];
        return object;
      }
    }, {
      key: "horizontalAngle",
      value: function horizontalAngle() {
        return Math.atan2(this.y, this.x);
      }
    }, {
      key: "verticalAngle",
      value: function verticalAngle() {
        return Math.atan2(this.x, this.y);
      }
    }, {
      key: "transform",
      value: function transform(matrix4) {
        return this.transformAsPoint(matrix4);
      }
    }, {
      key: "transformAsPoint",
      value: function transformAsPoint(matrix4) {
        gl_matrix_vec2__WEBPACK_IMPORTED_MODULE_8__["transformMat4"](this, this, matrix4);
        return this.check();
      }
    }, {
      key: "transformAsVector",
      value: function transformAsVector(matrix4) {
        Object(_lib_gl_matrix_extras__WEBPACK_IMPORTED_MODULE_9__["vec2_transformMat4AsVector"])(this, this, matrix4);
        return this.check();
      }
    }, {
      key: "transformByMatrix3",
      value: function transformByMatrix3(matrix3) {
        gl_matrix_vec2__WEBPACK_IMPORTED_MODULE_8__["transformMat3"](this, this, matrix3);
        return this.check();
      }
    }, {
      key: "transformByMatrix2x3",
      value: function transformByMatrix2x3(matrix2x3) {
        gl_matrix_vec2__WEBPACK_IMPORTED_MODULE_8__["transformMat2d"](this, this, matrix2x3);
        return this.check();
      }
    }, {
      key: "transformByMatrix2",
      value: function transformByMatrix2(matrix2) {
        gl_matrix_vec2__WEBPACK_IMPORTED_MODULE_8__["transformMat2"](this, this, matrix2);
        return this.check();
      }
    }, {
      key: "ELEMENTS",
      get: function get() {
        return 2;
      }
    }]);
  
    return Vector2;
  }(_base_vector__WEBPACK_IMPORTED_MODULE_5__["default"]);
  
  
  //# sourceMappingURL=vector2.js.map
  
  /***/ }),
  
  /***/ "../../node_modules/@math.gl/core/dist/esm/classes/vector3.js":
  /*!********************************************************************************************!*\
    !*** /Users/xintong/dev/loaders.gl/node_modules/@math.gl/core/dist/esm/classes/vector3.js ***!
    \********************************************************************************************/
  /*! exports provided: default */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Vector3; });
  /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "../../node_modules/@babel/runtime/helpers/esm/classCallCheck.js");
  /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "../../node_modules/@babel/runtime/helpers/esm/createClass.js");
  /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "../../node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js");
  /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "../../node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js");
  /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "../../node_modules/@babel/runtime/helpers/esm/inherits.js");
  /* harmony import */ var _base_vector__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./base/vector */ "../../node_modules/@math.gl/core/dist/esm/classes/base/vector.js");
  /* harmony import */ var _lib_common__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../lib/common */ "../../node_modules/@math.gl/core/dist/esm/lib/common.js");
  /* harmony import */ var _lib_validators__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../lib/validators */ "../../node_modules/@math.gl/core/dist/esm/lib/validators.js");
  /* harmony import */ var gl_matrix_vec3__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! gl-matrix/vec3 */ "../../node_modules/gl-matrix/esm/vec3.js");
  /* harmony import */ var _lib_gl_matrix_extras__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../lib/gl-matrix-extras */ "../../node_modules/@math.gl/core/dist/esm/lib/gl-matrix-extras.js");
  
  
  
  
  
  
  
  
  
  
  var ORIGIN = [0, 0, 0];
  
  var Vector3 = function (_Vector) {
    Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(Vector3, _Vector);
  
    function Vector3() {
      var _this;
  
      var x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
      var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
      var z = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
  
      Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, Vector3);
  
      _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(Vector3).call(this, -0, -0, -0));
  
      if (arguments.length === 1 && Object(_lib_common__WEBPACK_IMPORTED_MODULE_6__["isArray"])(x)) {
        _this.copy(x);
      } else {
        if (_lib_common__WEBPACK_IMPORTED_MODULE_6__["config"].debug) {
          Object(_lib_validators__WEBPACK_IMPORTED_MODULE_7__["checkNumber"])(x);
          Object(_lib_validators__WEBPACK_IMPORTED_MODULE_7__["checkNumber"])(y);
          Object(_lib_validators__WEBPACK_IMPORTED_MODULE_7__["checkNumber"])(z);
        }
  
        _this[0] = x;
        _this[1] = y;
        _this[2] = z;
      }
  
      return _this;
    }
  
    Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(Vector3, [{
      key: "set",
      value: function set(x, y, z) {
        this[0] = x;
        this[1] = y;
        this[2] = z;
        return this.check();
      }
    }, {
      key: "copy",
      value: function copy(array) {
        this[0] = array[0];
        this[1] = array[1];
        this[2] = array[2];
        return this.check();
      }
    }, {
      key: "fromObject",
      value: function fromObject(object) {
        if (_lib_common__WEBPACK_IMPORTED_MODULE_6__["config"].debug) {
          Object(_lib_validators__WEBPACK_IMPORTED_MODULE_7__["checkNumber"])(object.x);
          Object(_lib_validators__WEBPACK_IMPORTED_MODULE_7__["checkNumber"])(object.y);
          Object(_lib_validators__WEBPACK_IMPORTED_MODULE_7__["checkNumber"])(object.z);
        }
  
        this[0] = object.x;
        this[1] = object.y;
        this[2] = object.z;
        return this.check();
      }
    }, {
      key: "toObject",
      value: function toObject(object) {
        object.x = this[0];
        object.y = this[1];
        object.z = this[2];
        return object;
      }
    }, {
      key: "angle",
      value: function angle(vector) {
        return gl_matrix_vec3__WEBPACK_IMPORTED_MODULE_8__["angle"](this, vector);
      }
    }, {
      key: "cross",
      value: function cross(vector) {
        gl_matrix_vec3__WEBPACK_IMPORTED_MODULE_8__["cross"](this, this, vector);
        return this.check();
      }
    }, {
      key: "rotateX",
      value: function rotateX(_ref) {
        var radians = _ref.radians,
            _ref$origin = _ref.origin,
            origin = _ref$origin === void 0 ? ORIGIN : _ref$origin;
        gl_matrix_vec3__WEBPACK_IMPORTED_MODULE_8__["rotateX"](this, this, origin, radians);
        return this.check();
      }
    }, {
      key: "rotateY",
      value: function rotateY(_ref2) {
        var radians = _ref2.radians,
            _ref2$origin = _ref2.origin,
            origin = _ref2$origin === void 0 ? ORIGIN : _ref2$origin;
        gl_matrix_vec3__WEBPACK_IMPORTED_MODULE_8__["rotateY"](this, this, origin, radians);
        return this.check();
      }
    }, {
      key: "rotateZ",
      value: function rotateZ(_ref3) {
        var radians = _ref3.radians,
            _ref3$origin = _ref3.origin,
            origin = _ref3$origin === void 0 ? ORIGIN : _ref3$origin;
        gl_matrix_vec3__WEBPACK_IMPORTED_MODULE_8__["rotateZ"](this, this, origin, radians);
        return this.check();
      }
    }, {
      key: "transform",
      value: function transform(matrix4) {
        return this.transformAsPoint(matrix4);
      }
    }, {
      key: "transformAsPoint",
      value: function transformAsPoint(matrix4) {
        gl_matrix_vec3__WEBPACK_IMPORTED_MODULE_8__["transformMat4"](this, this, matrix4);
        return this.check();
      }
    }, {
      key: "transformAsVector",
      value: function transformAsVector(matrix4) {
        Object(_lib_gl_matrix_extras__WEBPACK_IMPORTED_MODULE_9__["vec3_transformMat4AsVector"])(this, this, matrix4);
        return this.check();
      }
    }, {
      key: "transformByMatrix3",
      value: function transformByMatrix3(matrix3) {
        gl_matrix_vec3__WEBPACK_IMPORTED_MODULE_8__["transformMat3"](this, this, matrix3);
        return this.check();
      }
    }, {
      key: "transformByMatrix2",
      value: function transformByMatrix2(matrix2) {
        Object(_lib_gl_matrix_extras__WEBPACK_IMPORTED_MODULE_9__["vec3_transformMat2"])(this, this, matrix2);
        return this.check();
      }
    }, {
      key: "transformByQuaternion",
      value: function transformByQuaternion(quaternion) {
        gl_matrix_vec3__WEBPACK_IMPORTED_MODULE_8__["transformQuat"](this, this, quaternion);
        return this.check();
      }
    }, {
      key: "ELEMENTS",
      get: function get() {
        return 3;
      }
    }, {
      key: "z",
      get: function get() {
        return this[2];
      },
      set: function set(value) {
        return this[2] = Object(_lib_validators__WEBPACK_IMPORTED_MODULE_7__["checkNumber"])(value);
      }
    }]);
  
    return Vector3;
  }(_base_vector__WEBPACK_IMPORTED_MODULE_5__["default"]);
  
  
  //# sourceMappingURL=vector3.js.map
  
  /***/ }),
  
  /***/ "../../node_modules/@math.gl/core/dist/esm/classes/vector4.js":
  /*!********************************************************************************************!*\
    !*** /Users/xintong/dev/loaders.gl/node_modules/@math.gl/core/dist/esm/classes/vector4.js ***!
    \********************************************************************************************/
  /*! exports provided: default */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Vector4; });
  /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "../../node_modules/@babel/runtime/helpers/esm/classCallCheck.js");
  /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "../../node_modules/@babel/runtime/helpers/esm/createClass.js");
  /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "../../node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js");
  /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "../../node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js");
  /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "../../node_modules/@babel/runtime/helpers/esm/inherits.js");
  /* harmony import */ var _base_vector__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./base/vector */ "../../node_modules/@math.gl/core/dist/esm/classes/base/vector.js");
  /* harmony import */ var _lib_common__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../lib/common */ "../../node_modules/@math.gl/core/dist/esm/lib/common.js");
  /* harmony import */ var _lib_validators__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../lib/validators */ "../../node_modules/@math.gl/core/dist/esm/lib/validators.js");
  /* harmony import */ var gl_matrix_vec3__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! gl-matrix/vec3 */ "../../node_modules/gl-matrix/esm/vec3.js");
  /* harmony import */ var _lib_gl_matrix_extras__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../lib/gl-matrix-extras */ "../../node_modules/@math.gl/core/dist/esm/lib/gl-matrix-extras.js");
  
  
  
  
  
  
  
  
  
  
  
  var Vector4 = function (_Vector) {
    Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(Vector4, _Vector);
  
    function Vector4() {
      var _this;
  
      var x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
      var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
      var z = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
      var w = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
  
      Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, Vector4);
  
      _this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(Vector4).call(this, -0, -0, -0, -0));
  
      if (Object(_lib_common__WEBPACK_IMPORTED_MODULE_6__["isArray"])(x) && arguments.length === 1) {
        _this.copy(x);
      } else {
        if (_lib_common__WEBPACK_IMPORTED_MODULE_6__["config"].debug) {
          Object(_lib_validators__WEBPACK_IMPORTED_MODULE_7__["checkNumber"])(x);
          Object(_lib_validators__WEBPACK_IMPORTED_MODULE_7__["checkNumber"])(y);
          Object(_lib_validators__WEBPACK_IMPORTED_MODULE_7__["checkNumber"])(z);
          Object(_lib_validators__WEBPACK_IMPORTED_MODULE_7__["checkNumber"])(w);
        }
  
        _this[0] = x;
        _this[1] = y;
        _this[2] = z;
        _this[3] = w;
      }
  
      return _this;
    }
  
    Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(Vector4, [{
      key: "set",
      value: function set(x, y, z, w) {
        this[0] = x;
        this[1] = y;
        this[2] = z;
        this[3] = w;
        return this.check();
      }
    }, {
      key: "copy",
      value: function copy(array) {
        this[0] = array[0];
        this[1] = array[1];
        this[2] = array[2];
        this[3] = array[3];
        return this.check();
      }
    }, {
      key: "fromObject",
      value: function fromObject(object) {
        if (_lib_common__WEBPACK_IMPORTED_MODULE_6__["config"].debug) {
          Object(_lib_validators__WEBPACK_IMPORTED_MODULE_7__["checkNumber"])(object.x);
          Object(_lib_validators__WEBPACK_IMPORTED_MODULE_7__["checkNumber"])(object.y);
          Object(_lib_validators__WEBPACK_IMPORTED_MODULE_7__["checkNumber"])(object.z);
          Object(_lib_validators__WEBPACK_IMPORTED_MODULE_7__["checkNumber"])(object.w);
        }
  
        this[0] = object.x;
        this[1] = object.y;
        this[2] = object.z;
        this[3] = object.w;
        return this;
      }
    }, {
      key: "toObject",
      value: function toObject(object) {
        object.x = this[0];
        object.y = this[1];
        object.z = this[2];
        object.w = this[3];
        return object;
      }
    }, {
      key: "transform",
      value: function transform(matrix4) {
        gl_matrix_vec3__WEBPACK_IMPORTED_MODULE_8__["transformMat4"](this, this, matrix4);
        return this.check();
      }
    }, {
      key: "transformByMatrix3",
      value: function transformByMatrix3(matrix3) {
        Object(_lib_gl_matrix_extras__WEBPACK_IMPORTED_MODULE_9__["vec4_transformMat3"])(this, this, matrix3);
        return this.check();
      }
    }, {
      key: "transformByMatrix2",
      value: function transformByMatrix2(matrix2) {
        Object(_lib_gl_matrix_extras__WEBPACK_IMPORTED_MODULE_9__["vec4_transformMat2"])(this, this, matrix2);
        return this.check();
      }
    }, {
      key: "transformByQuaternion",
      value: function transformByQuaternion(quaternion) {
        gl_matrix_vec3__WEBPACK_IMPORTED_MODULE_8__["transformQuat"](this, this, quaternion);
        return this.check();
      }
    }, {
      key: "applyMatrix4",
      value: function applyMatrix4(m) {
        m.transform(this, this);
        return this;
      }
    }, {
      key: "ELEMENTS",
      get: function get() {
        return 4;
      }
    }, {
      key: "z",
      get: function get() {
        return this[2];
      },
      set: function set(value) {
        return this[2] = Object(_lib_validators__WEBPACK_IMPORTED_MODULE_7__["checkNumber"])(value);
      }
    }, {
      key: "w",
      get: function get() {
        return this[3];
      },
      set: function set(value) {
        return this[3] = Object(_lib_validators__WEBPACK_IMPORTED_MODULE_7__["checkNumber"])(value);
      }
    }]);
  
    return Vector4;
  }(_base_vector__WEBPACK_IMPORTED_MODULE_5__["default"]);
  
  
  //# sourceMappingURL=vector4.js.map
  
  /***/ }),
  
  /***/ "../../node_modules/@math.gl/core/dist/esm/index.js":
  /*!**********************************************************************************!*\
    !*** /Users/xintong/dev/loaders.gl/node_modules/@math.gl/core/dist/esm/index.js ***!
    \**********************************************************************************/
  /*! exports provided: Vector2, Vector3, Vector4, Matrix3, Matrix4, Quaternion, config, configure, formatValue, isArray, clone, equals, exactEquals, toRadians, toDegrees, radians, degrees, sin, cos, tan, asin, acos, atan, clamp, lerp, _withEpsilon, checkNumber, _MathUtils, _SphericalCoordinates, _Pose, _Euler, _Polygon, assert */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* WEBPACK VAR INJECTION */(function(global) {/* harmony import */ var math_gl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! math.gl */ "../../node_modules/math.gl/dist/esm/index.js");
  /* harmony import */ var _classes_vector2__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./classes/vector2 */ "../../node_modules/@math.gl/core/dist/esm/classes/vector2.js");
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Vector2", function() { return _classes_vector2__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  
  /* harmony import */ var _classes_vector3__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./classes/vector3 */ "../../node_modules/@math.gl/core/dist/esm/classes/vector3.js");
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Vector3", function() { return _classes_vector3__WEBPACK_IMPORTED_MODULE_2__["default"]; });
  
  /* harmony import */ var _classes_vector4__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./classes/vector4 */ "../../node_modules/@math.gl/core/dist/esm/classes/vector4.js");
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Vector4", function() { return _classes_vector4__WEBPACK_IMPORTED_MODULE_3__["default"]; });
  
  /* harmony import */ var _classes_matrix3__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./classes/matrix3 */ "../../node_modules/@math.gl/core/dist/esm/classes/matrix3.js");
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Matrix3", function() { return _classes_matrix3__WEBPACK_IMPORTED_MODULE_4__["default"]; });
  
  /* harmony import */ var _classes_matrix4__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./classes/matrix4 */ "../../node_modules/@math.gl/core/dist/esm/classes/matrix4.js");
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Matrix4", function() { return _classes_matrix4__WEBPACK_IMPORTED_MODULE_5__["default"]; });
  
  /* harmony import */ var _classes_quaternion__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./classes/quaternion */ "../../node_modules/@math.gl/core/dist/esm/classes/quaternion.js");
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Quaternion", function() { return _classes_quaternion__WEBPACK_IMPORTED_MODULE_6__["default"]; });
  
  /* harmony import */ var _lib_common__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./lib/common */ "../../node_modules/@math.gl/core/dist/esm/lib/common.js");
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "config", function() { return _lib_common__WEBPACK_IMPORTED_MODULE_7__["config"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "configure", function() { return _lib_common__WEBPACK_IMPORTED_MODULE_7__["configure"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "formatValue", function() { return _lib_common__WEBPACK_IMPORTED_MODULE_7__["formatValue"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isArray", function() { return _lib_common__WEBPACK_IMPORTED_MODULE_7__["isArray"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "clone", function() { return _lib_common__WEBPACK_IMPORTED_MODULE_7__["clone"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "equals", function() { return _lib_common__WEBPACK_IMPORTED_MODULE_7__["equals"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "exactEquals", function() { return _lib_common__WEBPACK_IMPORTED_MODULE_7__["exactEquals"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toRadians", function() { return _lib_common__WEBPACK_IMPORTED_MODULE_7__["toRadians"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toDegrees", function() { return _lib_common__WEBPACK_IMPORTED_MODULE_7__["toDegrees"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "radians", function() { return _lib_common__WEBPACK_IMPORTED_MODULE_7__["radians"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "degrees", function() { return _lib_common__WEBPACK_IMPORTED_MODULE_7__["degrees"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sin", function() { return _lib_common__WEBPACK_IMPORTED_MODULE_7__["sin"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "cos", function() { return _lib_common__WEBPACK_IMPORTED_MODULE_7__["cos"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "tan", function() { return _lib_common__WEBPACK_IMPORTED_MODULE_7__["tan"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "asin", function() { return _lib_common__WEBPACK_IMPORTED_MODULE_7__["asin"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "acos", function() { return _lib_common__WEBPACK_IMPORTED_MODULE_7__["acos"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "atan", function() { return _lib_common__WEBPACK_IMPORTED_MODULE_7__["atan"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "clamp", function() { return _lib_common__WEBPACK_IMPORTED_MODULE_7__["clamp"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lerp", function() { return _lib_common__WEBPACK_IMPORTED_MODULE_7__["lerp"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_withEpsilon", function() { return _lib_common__WEBPACK_IMPORTED_MODULE_7__["withEpsilon"]; });
  
  /* harmony import */ var _lib_validators__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./lib/validators */ "../../node_modules/@math.gl/core/dist/esm/lib/validators.js");
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "checkNumber", function() { return _lib_validators__WEBPACK_IMPORTED_MODULE_8__["checkNumber"]; });
  
  /* harmony import */ var _lib_math_utils__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./lib/math-utils */ "../../node_modules/@math.gl/core/dist/esm/lib/math-utils.js");
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_MathUtils", function() { return _lib_math_utils__WEBPACK_IMPORTED_MODULE_9__["default"]; });
  
  /* harmony import */ var _classes_spherical_coordinates__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./classes/spherical-coordinates */ "../../node_modules/@math.gl/core/dist/esm/classes/spherical-coordinates.js");
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_SphericalCoordinates", function() { return _classes_spherical_coordinates__WEBPACK_IMPORTED_MODULE_10__["default"]; });
  
  /* harmony import */ var _classes_pose__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./classes/pose */ "../../node_modules/@math.gl/core/dist/esm/classes/pose.js");
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_Pose", function() { return _classes_pose__WEBPACK_IMPORTED_MODULE_11__["default"]; });
  
  /* harmony import */ var _classes_euler__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./classes/euler */ "../../node_modules/@math.gl/core/dist/esm/classes/euler.js");
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_Euler", function() { return _classes_euler__WEBPACK_IMPORTED_MODULE_12__["default"]; });
  
  /* harmony import */ var _addons_polygon__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./addons/polygon */ "../../node_modules/@math.gl/core/dist/esm/addons/polygon.js");
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_Polygon", function() { return _addons_polygon__WEBPACK_IMPORTED_MODULE_13__["default"]; });
  
  /* harmony import */ var _lib_assert__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./lib/assert */ "../../node_modules/@math.gl/core/dist/esm/lib/assert.js");
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "assert", function() { return _lib_assert__WEBPACK_IMPORTED_MODULE_14__["default"]; });
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  var globals = {
    self: typeof self !== 'undefined' && self,
    window: typeof window !== 'undefined' && window,
    global: typeof global !== 'undefined' && global
  };
  var global_ = globals.global || globals.self || globals.window;
  global_.mathgl = {
    config: math_gl__WEBPACK_IMPORTED_MODULE_0__["config"]
  };
  //# sourceMappingURL=index.js.map
  /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../webpack/buildin/global.js */ "../../node_modules/webpack/buildin/global.js")))
  
  /***/ }),
  
  /***/ "../../node_modules/@math.gl/core/dist/esm/lib/assert.js":
  /*!***************************************************************************************!*\
    !*** /Users/xintong/dev/loaders.gl/node_modules/@math.gl/core/dist/esm/lib/assert.js ***!
    \***************************************************************************************/
  /*! exports provided: default */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return assert; });
  function assert(condition, message) {
    if (!condition) {
      throw new Error("math.gl assertion ".concat(message));
    }
  }
  //# sourceMappingURL=assert.js.map
  
  /***/ }),
  
  /***/ "../../node_modules/@math.gl/core/dist/esm/lib/common.js":
  /*!***************************************************************************************!*\
    !*** /Users/xintong/dev/loaders.gl/node_modules/@math.gl/core/dist/esm/lib/common.js ***!
    \***************************************************************************************/
  /*! exports provided: config, configure, formatValue, isArray, clone, toRadians, toDegrees, radians, degrees, sin, cos, tan, asin, acos, atan, clamp, lerp, equals, exactEquals, withEpsilon */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "config", function() { return config; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "configure", function() { return configure; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "formatValue", function() { return formatValue; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isArray", function() { return isArray; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "clone", function() { return clone; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toRadians", function() { return toRadians; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toDegrees", function() { return toDegrees; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "radians", function() { return radians; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "degrees", function() { return degrees; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sin", function() { return sin; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cos", function() { return cos; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "tan", function() { return tan; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "asin", function() { return asin; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "acos", function() { return acos; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "atan", function() { return atan; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "clamp", function() { return clamp; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lerp", function() { return lerp; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "equals", function() { return equals; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "exactEquals", function() { return exactEquals; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "withEpsilon", function() { return withEpsilon; });
  /* harmony import */ var _babel_runtime_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/typeof */ "../../node_modules/@babel/runtime/helpers/esm/typeof.js");
  /* harmony import */ var _babel_runtime_helpers_esm_construct__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/construct */ "../../node_modules/@babel/runtime/helpers/esm/construct.js");
  /* harmony import */ var _babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/toConsumableArray */ "../../node_modules/@babel/runtime/helpers/esm/toConsumableArray.js");
  /* harmony import */ var _assert__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./assert */ "../../node_modules/@math.gl/core/dist/esm/lib/assert.js");
  
  
  
  
  var RADIANS_TO_DEGREES = 1 / Math.PI * 180;
  var DEGREES_TO_RADIANS = 1 / 180 * Math.PI;
  var config = {};
  config.EPSILON = 1e-12;
  config.debug = false;
  config.precision = 4;
  config.printTypes = false;
  config.printDegrees = false;
  config.printRowMajor = true;
  
  function configure() {
    var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  
    for (var key in options) {
      Object(_assert__WEBPACK_IMPORTED_MODULE_3__["default"])(key in config);
      config[key] = options[key];
    }
  
    return config;
  }
  
  function round(value) {
    return Math.round(value / config.EPSILON) * config.EPSILON;
  }
  
  function formatValue(value) {
    var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
        _ref$precision = _ref.precision,
        precision = _ref$precision === void 0 ? config.precision || 4 : _ref$precision;
  
    value = round(value);
    return "".concat(parseFloat(value.toPrecision(precision)));
  }
  function isArray(value) {
    return Array.isArray(value) || ArrayBuffer.isView(value) && value.length !== undefined;
  }
  
  function duplicateArray(array) {
    return array.clone ? array.clone() : new Array(array.length);
  }
  
  function clone(array) {
    return array.clone ? array.clone() : Object(_babel_runtime_helpers_esm_construct__WEBPACK_IMPORTED_MODULE_1__["default"])(Array, Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_2__["default"])(array));
  }
  
  function map(value, func, result) {
    if (isArray(value)) {
      result = result || duplicateArray(value);
  
      for (var i = 0; i < result.length && i < value.length; ++i) {
        result[i] = func(value[i], i, result);
      }
  
      return result;
    }
  
    return func(value);
  }
  
  function toRadians(degrees) {
    return radians(degrees);
  }
  function toDegrees(radians) {
    return degrees(radians);
  }
  function radians(degrees, result) {
    return map(degrees, function (degrees) {
      return degrees * DEGREES_TO_RADIANS;
    }, result);
  }
  function degrees(radians, result) {
    return map(radians, function (radians) {
      return radians * RADIANS_TO_DEGREES;
    }, result);
  }
  function sin(radians) {
    return map(radians, function (angle) {
      return Math.sin(angle);
    });
  }
  function cos(radians) {
    return map(radians, function (angle) {
      return Math.cos(angle);
    });
  }
  function tan(radians) {
    return map(radians, function (angle) {
      return Math.tan(angle);
    });
  }
  function asin(radians) {
    return map(radians, function (angle) {
      return Math.asin(angle);
    });
  }
  function acos(radians) {
    return map(radians, function (angle) {
      return Math.acos(angle);
    });
  }
  function atan(radians) {
    return map(radians, function (angle) {
      return Math.atan(angle);
    });
  }
  function clamp(value, min, max) {
    return map(value, function (value) {
      return Math.max(min, Math.min(max, value));
    });
  }
  function lerp(a, b, t) {
    if (isArray(a)) {
      return a.map(function (ai, i) {
        return lerp(ai, b[i], t);
      });
    }
  
    return t * b + (1 - t) * a;
  }
  function equals(a, b, epsilon) {
    var oldEpsilon = config.EPSILON;
  
    if (epsilon) {
      config.EPSILON = epsilon;
    }
  
    try {
      if (a === b) {
        return true;
      }
  
      if (isArray(a) && isArray(b)) {
        if (a.length !== b.length) {
          return false;
        }
  
        for (var i = 0; i < a.length; ++i) {
          if (!equals(a[i], b[i])) {
            return false;
          }
        }
  
        return true;
      }
  
      if (a && a.equals) {
        return a.equals(b);
      }
  
      if (b && b.equals) {
        return b.equals(a);
      }
  
      if (Number.isFinite(a) && Number.isFinite(b)) {
        return Math.abs(a - b) <= config.EPSILON * Math.max(1.0, Math.abs(a), Math.abs(b));
      }
  
      return false;
    } finally {
      config.EPSILON = oldEpsilon;
    }
  }
  function exactEquals(a, b) {
    if (a === b) {
      return true;
    }
  
    if (a && Object(_babel_runtime_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__["default"])(a) === 'object' && b && Object(_babel_runtime_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__["default"])(b) === 'object') {
      if (a.constructor !== b.constructor) {
        return false;
      }
  
      if (a.exactEquals) {
        return a.exactEquals(b);
      }
    }
  
    if (isArray(a) && isArray(b)) {
      if (a.length !== b.length) {
        return false;
      }
  
      for (var i = 0; i < a.length; ++i) {
        if (!exactEquals(a[i], b[i])) {
          return false;
        }
      }
  
      return true;
    }
  
    return false;
  }
  function withEpsilon(EPSILON, func) {
    var oldPrecision = config.EPSILON;
    config.EPSILON = EPSILON;
    var value;
  
    try {
      value = func();
    } finally {
      config.EPSILON = oldPrecision;
    }
  
    return value;
  }
  //# sourceMappingURL=common.js.map
  
  /***/ }),
  
  /***/ "../../node_modules/@math.gl/core/dist/esm/lib/gl-matrix-extras.js":
  /*!*************************************************************************************************!*\
    !*** /Users/xintong/dev/loaders.gl/node_modules/@math.gl/core/dist/esm/lib/gl-matrix-extras.js ***!
    \*************************************************************************************************/
  /*! exports provided: vec2_transformMat4AsVector, vec3_transformMat4AsVector, vec3_transformMat2, vec4_transformMat2, vec4_transformMat3 */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "vec2_transformMat4AsVector", function() { return vec2_transformMat4AsVector; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "vec3_transformMat4AsVector", function() { return vec3_transformMat4AsVector; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "vec3_transformMat2", function() { return vec3_transformMat2; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "vec4_transformMat2", function() { return vec4_transformMat2; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "vec4_transformMat3", function() { return vec4_transformMat3; });
  function vec2_transformMat4AsVector(out, a, m) {
    var x = a[0];
    var y = a[1];
    var w = m[3] * x + m[7] * y || 1.0;
    out[0] = (m[0] * x + m[4] * y) / w;
    out[1] = (m[1] * x + m[5] * y) / w;
    return out;
  }
  function vec3_transformMat4AsVector(out, a, m) {
    var x = a[0];
    var y = a[1];
    var z = a[2];
    var w = m[3] * x + m[7] * y + m[11] * z || 1.0;
    out[0] = (m[0] * x + m[4] * y + m[8] * z) / w;
    out[1] = (m[1] * x + m[5] * y + m[9] * z) / w;
    out[2] = (m[2] * x + m[6] * y + m[10] * z) / w;
    return out;
  }
  function vec3_transformMat2(out, a, m) {
    var x = a[0];
    var y = a[1];
    out[0] = m[0] * x + m[2] * y;
    out[1] = m[1] * x + m[3] * y;
    out[2] = a[2];
    return out;
  }
  function vec4_transformMat2(out, a, m) {
    var x = a[0];
    var y = a[1];
    out[0] = m[0] * x + m[2] * y;
    out[1] = m[1] * x + m[3] * y;
    out[2] = a[2];
    out[3] = a[3];
    return out;
  }
  function vec4_transformMat3(out, a, m) {
    var x = a[0];
    var y = a[1];
    var z = a[2];
    out[0] = m[0] * x + m[3] * y + m[6] * z;
    out[1] = m[1] * x + m[4] * y + m[7] * z;
    out[2] = m[2] * x + m[5] * y + m[8] * z;
    out[3] = a[3];
    return out;
  }
  //# sourceMappingURL=gl-matrix-extras.js.map
  
  /***/ }),
  
  /***/ "../../node_modules/@math.gl/core/dist/esm/lib/math-utils.js":
  /*!*******************************************************************************************!*\
    !*** /Users/xintong/dev/loaders.gl/node_modules/@math.gl/core/dist/esm/lib/math-utils.js ***!
    \*******************************************************************************************/
  /*! exports provided: default */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony default export */ __webpack_exports__["default"] = ({
    EPSILON1: 1e-1,
    EPSILON2: 1e-2,
    EPSILON3: 1e-3,
    EPSILON4: 1e-4,
    EPSILON5: 1e-5,
    EPSILON6: 1e-6,
    EPSILON7: 1e-7,
    EPSILON8: 1e-8,
    EPSILON9: 1e-9,
    EPSILON10: 1e-10,
    EPSILON11: 1e-11,
    EPSILON12: 1e-12,
    EPSILON13: 1e-13,
    EPSILON14: 1e-14,
    EPSILON15: 1e-15,
    EPSILON16: 1e-16,
    EPSILON17: 1e-17,
    EPSILON18: 1e-18,
    EPSILON19: 1e-19,
    EPSILON20: 1e-20,
    PI_OVER_TWO: Math.PI / 2,
    PI_OVER_FOUR: Math.PI / 4,
    PI_OVER_SIX: Math.PI / 6,
    TWO_PI: Math.PI * 2
  });
  //# sourceMappingURL=math-utils.js.map
  
  /***/ }),
  
  /***/ "../../node_modules/@math.gl/core/dist/esm/lib/validators.js":
  /*!*******************************************************************************************!*\
    !*** /Users/xintong/dev/loaders.gl/node_modules/@math.gl/core/dist/esm/lib/validators.js ***!
    \*******************************************************************************************/
  /*! exports provided: validateVector, checkNumber, checkVector, deprecated */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "validateVector", function() { return validateVector; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "checkNumber", function() { return checkNumber; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "checkVector", function() { return checkVector; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "deprecated", function() { return deprecated; });
  /* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common */ "../../node_modules/@math.gl/core/dist/esm/lib/common.js");
  
  function validateVector(v, length) {
    if (v.length !== length) {
      return false;
    }
  
    for (var i = 0; i < v.length; ++i) {
      if (!Number.isFinite(v[i])) {
        return false;
      }
    }
  
    return true;
  }
  function checkNumber(value) {
    if (!Number.isFinite(value)) {
      throw new Error("Invalid number ".concat(value));
    }
  
    return value;
  }
  function checkVector(v, length, callerName) {
    if (_common__WEBPACK_IMPORTED_MODULE_0__["config"].debug && !validateVector(v, length)) {
      throw new Error("math.gl: ".concat(callerName | '', " some fields set to invalid numbers'"));
    }
  
    return v;
  }
  var map = {};
  function deprecated(method, version) {
    if (!map[method]) {
      map[method] = true;
      console.warn("".concat(method, " has been removed in version ").concat(version, ", see upgrade guide for more information"));
    }
  }
  //# sourceMappingURL=validators.js.map
  
  /***/ }),
  
  /***/ "../../node_modules/@math.gl/culling/dist/esm/algorithms/bounding-box-from-points.js":
  /*!*******************************************************************************************************************!*\
    !*** /Users/xintong/dev/loaders.gl/node_modules/@math.gl/culling/dist/esm/algorithms/bounding-box-from-points.js ***!
    \*******************************************************************************************************************/
  /*! exports provided: default */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return makeOrientedBoundingBoxfromPoints; });
  /* harmony import */ var math_gl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! math.gl */ "../../node_modules/math.gl/dist/esm/index.js");
  /* harmony import */ var _compute_eigen_decomposition__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./compute-eigen-decomposition */ "../../node_modules/@math.gl/culling/dist/esm/algorithms/compute-eigen-decomposition.js");
  
  
  var scratchVector2 = new math_gl__WEBPACK_IMPORTED_MODULE_0__["Vector3"]();
  var scratchVector3 = new math_gl__WEBPACK_IMPORTED_MODULE_0__["Vector3"]();
  var scratchVector4 = new math_gl__WEBPACK_IMPORTED_MODULE_0__["Vector3"]();
  var scratchVector5 = new math_gl__WEBPACK_IMPORTED_MODULE_0__["Vector3"]();
  var scratchVector6 = new math_gl__WEBPACK_IMPORTED_MODULE_0__["Vector3"]();
  var scratchCovarianceResult = new math_gl__WEBPACK_IMPORTED_MODULE_0__["Matrix3"]();
  var scratchEigenResult = {
    diagonal: new math_gl__WEBPACK_IMPORTED_MODULE_0__["Matrix3"](),
    unitary: new math_gl__WEBPACK_IMPORTED_MODULE_0__["Matrix3"]()
  };
  function makeOrientedBoundingBoxfromPoints(positions, result) {
    if (!positions || positions.length === 0) {
      result.halfAxes = new math_gl__WEBPACK_IMPORTED_MODULE_0__["Matrix3"]([0, 0, 0, 0, 0, 0, 0, 0, 0]);
      result.center = new math_gl__WEBPACK_IMPORTED_MODULE_0__["Vector3"]();
      return result;
    }
  
    var length = positions.length;
    var meanPoint = new math_gl__WEBPACK_IMPORTED_MODULE_0__["Vector3"](0, 0, 0);
    var _iteratorNormalCompletion = true;
    var _didIteratorError = false;
    var _iteratorError = undefined;
  
    try {
      for (var _iterator = positions[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
        var position = _step.value;
        meanPoint.add(position);
      }
    } catch (err) {
      _didIteratorError = true;
      _iteratorError = err;
    } finally {
      try {
        if (!_iteratorNormalCompletion && _iterator["return"] != null) {
          _iterator["return"]();
        }
      } finally {
        if (_didIteratorError) {
          throw _iteratorError;
        }
      }
    }
  
    var invLength = 1.0 / length;
    meanPoint.multiplyByScalar(invLength);
    var exx = 0.0;
    var exy = 0.0;
    var exz = 0.0;
    var eyy = 0.0;
    var eyz = 0.0;
    var ezz = 0.0;
    var _iteratorNormalCompletion2 = true;
    var _didIteratorError2 = false;
    var _iteratorError2 = undefined;
  
    try {
      for (var _iterator2 = positions[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
        var _position = _step2.value;
        var p = scratchVector2.copy(_position).subtract(meanPoint);
        exx += p.x * p.x;
        exy += p.x * p.y;
        exz += p.x * p.z;
        eyy += p.y * p.y;
        eyz += p.y * p.z;
        ezz += p.z * p.z;
      }
    } catch (err) {
      _didIteratorError2 = true;
      _iteratorError2 = err;
    } finally {
      try {
        if (!_iteratorNormalCompletion2 && _iterator2["return"] != null) {
          _iterator2["return"]();
        }
      } finally {
        if (_didIteratorError2) {
          throw _iteratorError2;
        }
      }
    }
  
    exx *= invLength;
    exy *= invLength;
    exz *= invLength;
    eyy *= invLength;
    eyz *= invLength;
    ezz *= invLength;
    var covarianceMatrix = scratchCovarianceResult;
    covarianceMatrix[0] = exx;
    covarianceMatrix[1] = exy;
    covarianceMatrix[2] = exz;
    covarianceMatrix[3] = exy;
    covarianceMatrix[4] = eyy;
    covarianceMatrix[5] = eyz;
    covarianceMatrix[6] = exz;
    covarianceMatrix[7] = eyz;
    covarianceMatrix[8] = ezz;
  
    var _computeEigenDecompos = Object(_compute_eigen_decomposition__WEBPACK_IMPORTED_MODULE_1__["default"])(covarianceMatrix, scratchEigenResult),
        unitary = _computeEigenDecompos.unitary;
  
    var rotation = result.halfAxes.copy(unitary);
    var v1 = rotation.getColumn(0, scratchVector4);
    var v2 = rotation.getColumn(1, scratchVector5);
    var v3 = rotation.getColumn(2, scratchVector6);
    var u1 = -Number.MAX_VALUE;
    var u2 = -Number.MAX_VALUE;
    var u3 = -Number.MAX_VALUE;
    var l1 = Number.MAX_VALUE;
    var l2 = Number.MAX_VALUE;
    var l3 = Number.MAX_VALUE;
    var _iteratorNormalCompletion3 = true;
    var _didIteratorError3 = false;
    var _iteratorError3 = undefined;
  
    try {
      for (var _iterator3 = positions[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
        var _position2 = _step3.value;
        u1 = Math.max(_position2.dot(v1), u1);
        u2 = Math.max(_position2.dot(v2), u2);
        u3 = Math.max(_position2.dot(v3), u3);
        l1 = Math.min(_position2.dot(v1), l1);
        l2 = Math.min(_position2.dot(v2), l2);
        l3 = Math.min(_position2.dot(v3), l3);
      }
    } catch (err) {
      _didIteratorError3 = true;
      _iteratorError3 = err;
    } finally {
      try {
        if (!_iteratorNormalCompletion3 && _iterator3["return"] != null) {
          _iterator3["return"]();
        }
      } finally {
        if (_didIteratorError3) {
          throw _iteratorError3;
        }
      }
    }
  
    v1 = v1.multiplyByScalar(0.5 * (l1 + u1));
    v2 = v2.multiplyByScalar(0.5 * (l2 + u2));
    v3 = v3.multiplyByScalar(0.5 * (l3 + u3));
    result.center.copy(v1).add(v2).add(v3);
    var scale = scratchVector3.set(u1 - l1, u2 - l2, u3 - l3).multiplyByScalar(0.5);
    result.halfAxes.multiplyByScalar(scale);
    return result;
  }
  //# sourceMappingURL=bounding-box-from-points.js.map
  
  /***/ }),
  
  /***/ "../../node_modules/@math.gl/culling/dist/esm/algorithms/bounding-sphere-from-points.js":
  /*!**********************************************************************************************************************!*\
    !*** /Users/xintong/dev/loaders.gl/node_modules/@math.gl/culling/dist/esm/algorithms/bounding-sphere-from-points.js ***!
    \**********************************************************************************************************************/
  /*! exports provided: makeBoundingSphereFromPoints */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "makeBoundingSphereFromPoints", function() { return makeBoundingSphereFromPoints; });
  /* harmony import */ var math_gl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! math.gl */ "../../node_modules/math.gl/dist/esm/index.js");
  /* harmony import */ var _lib_bounding_sphere__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../lib/bounding-sphere */ "../../node_modules/@math.gl/culling/dist/esm/lib/bounding-sphere.js");
  
  
  var fromPointsXMin = new math_gl__WEBPACK_IMPORTED_MODULE_0__["Vector3"]();
  var fromPointsYMin = new math_gl__WEBPACK_IMPORTED_MODULE_0__["Vector3"]();
  var fromPointsZMin = new math_gl__WEBPACK_IMPORTED_MODULE_0__["Vector3"]();
  var fromPointsXMax = new math_gl__WEBPACK_IMPORTED_MODULE_0__["Vector3"]();
  var fromPointsYMax = new math_gl__WEBPACK_IMPORTED_MODULE_0__["Vector3"]();
  var fromPointsZMax = new math_gl__WEBPACK_IMPORTED_MODULE_0__["Vector3"]();
  var fromPointsCurrentPos = new math_gl__WEBPACK_IMPORTED_MODULE_0__["Vector3"]();
  var fromPointsScratch = new math_gl__WEBPACK_IMPORTED_MODULE_0__["Vector3"]();
  var fromPointsRitterCenter = new math_gl__WEBPACK_IMPORTED_MODULE_0__["Vector3"]();
  var fromPointsMinBoxPt = new math_gl__WEBPACK_IMPORTED_MODULE_0__["Vector3"]();
  var fromPointsMaxBoxPt = new math_gl__WEBPACK_IMPORTED_MODULE_0__["Vector3"]();
  var fromPointsNaiveCenterScratch = new math_gl__WEBPACK_IMPORTED_MODULE_0__["Vector3"]();
  var volumeConstant = 4.0 / 3.0 * Math.PI;
  function makeBoundingSphereFromPoints(positions) {
    var result = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : new _lib_bounding_sphere__WEBPACK_IMPORTED_MODULE_1__["default"]();
  
    if (!positions || positions.length === 0) {
      return result.fromCenterRadius([0, 0, 0], 0);
    }
  
    var currentPos = fromPointsCurrentPos.copy(positions[0]);
    var xMin = fromPointsXMin.copy(currentPos);
    var yMin = fromPointsYMin.copy(currentPos);
    var zMin = fromPointsZMin.copy(currentPos);
    var xMax = fromPointsXMax.copy(currentPos);
    var yMax = fromPointsYMax.copy(currentPos);
    var zMax = fromPointsZMax.copy(currentPos);
    var _iteratorNormalCompletion = true;
    var _didIteratorError = false;
    var _iteratorError = undefined;
  
    try {
      for (var _iterator = positions[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
        var position = _step.value;
        currentPos.copy(position);
        var x = currentPos.x;
        var y = currentPos.y;
        var z = currentPos.z;
  
        if (x < xMin.x) {
          currentPos.copy(xMin);
        }
  
        if (x > xMax.x) {
          currentPos.copy(xMax);
        }
  
        if (y < yMin.y) {
          currentPos.copy(yMin);
        }
  
        if (y > yMax.y) {
          currentPos.copy(yMax);
        }
  
        if (z < zMin.z) {
          currentPos.copy(zMin);
        }
  
        if (z > zMax.z) {
          currentPos.copy(zMax);
        }
      }
    } catch (err) {
      _didIteratorError = true;
      _iteratorError = err;
    } finally {
      try {
        if (!_iteratorNormalCompletion && _iterator["return"] != null) {
          _iterator["return"]();
        }
      } finally {
        if (_didIteratorError) {
          throw _iteratorError;
        }
      }
    }
  
    var xSpan = fromPointsScratch.copy(xMax).subtract(xMin).magnitudeSquared();
    var ySpan = fromPointsScratch.copy(yMax).subtract(yMin).magnitudeSquared();
    var zSpan = fromPointsScratch.copy(zMax).subtract(zMin).magnitudeSquared();
    var diameter1 = xMin;
    var diameter2 = xMax;
    var maxSpan = xSpan;
  
    if (ySpan > maxSpan) {
      maxSpan = ySpan;
      diameter1 = yMin;
      diameter2 = yMax;
    }
  
    if (zSpan > maxSpan) {
      maxSpan = zSpan;
      diameter1 = zMin;
      diameter2 = zMax;
    }
  
    var ritterCenter = fromPointsRitterCenter;
    ritterCenter.x = (diameter1.x + diameter2.x) * 0.5;
    ritterCenter.y = (diameter1.y + diameter2.y) * 0.5;
    ritterCenter.z = (diameter1.z + diameter2.z) * 0.5;
    var radiusSquared = fromPointsScratch.copy(diameter2).subtract(ritterCenter).magnitudeSquared();
    var ritterRadius = Math.sqrt(radiusSquared);
    var minBoxPt = fromPointsMinBoxPt;
    minBoxPt.x = xMin.x;
    minBoxPt.y = yMin.y;
    minBoxPt.z = zMin.z;
    var maxBoxPt = fromPointsMaxBoxPt;
    maxBoxPt.x = xMax.x;
    maxBoxPt.y = yMax.y;
    maxBoxPt.z = zMax.z;
    var naiveCenter = fromPointsNaiveCenterScratch.copy(minBoxPt).add(maxBoxPt).multiplyByScalar(0.5);
    var naiveRadius = 0;
    var _iteratorNormalCompletion2 = true;
    var _didIteratorError2 = false;
    var _iteratorError2 = undefined;
  
    try {
      for (var _iterator2 = positions[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
        var _position = _step2.value;
        currentPos.copy(_position);
        var r = fromPointsScratch.copy(currentPos).subtract(naiveCenter).magnitude();
  
        if (r > naiveRadius) {
          naiveRadius = r;
        }
  
        var oldCenterToPointSquared = fromPointsScratch.copy(currentPos).subtract(ritterCenter).magnitudeSquared();
  
        if (oldCenterToPointSquared > radiusSquared) {
          var oldCenterToPoint = Math.sqrt(oldCenterToPointSquared);
          ritterRadius = (ritterRadius + oldCenterToPoint) * 0.5;
          radiusSquared = ritterRadius * ritterRadius;
          var oldToNew = oldCenterToPoint - ritterRadius;
          ritterCenter.x = (ritterRadius * ritterCenter.x + oldToNew * currentPos.x) / oldCenterToPoint;
          ritterCenter.y = (ritterRadius * ritterCenter.y + oldToNew * currentPos.y) / oldCenterToPoint;
          ritterCenter.z = (ritterRadius * ritterCenter.z + oldToNew * currentPos.z) / oldCenterToPoint;
        }
      }
    } catch (err) {
      _didIteratorError2 = true;
      _iteratorError2 = err;
    } finally {
      try {
        if (!_iteratorNormalCompletion2 && _iterator2["return"] != null) {
          _iterator2["return"]();
        }
      } finally {
        if (_didIteratorError2) {
          throw _iteratorError2;
        }
      }
    }
  
    if (ritterRadius < naiveRadius) {
      ritterCenter.to(result.center);
      result.radius = ritterRadius;
    } else {
      naiveCenter.to(result.center);
      result.radius = naiveRadius;
    }
  
    return result;
  }
  //# sourceMappingURL=bounding-sphere-from-points.js.map
  
  /***/ }),
  
  /***/ "../../node_modules/@math.gl/culling/dist/esm/algorithms/compute-eigen-decomposition.js":
  /*!**********************************************************************************************************************!*\
    !*** /Users/xintong/dev/loaders.gl/node_modules/@math.gl/culling/dist/esm/algorithms/compute-eigen-decomposition.js ***!
    \**********************************************************************************************************************/
  /*! exports provided: default */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return computeEigenDecomposition; });
  /* harmony import */ var math_gl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! math.gl */ "../../node_modules/math.gl/dist/esm/index.js");
  
  var scratchMatrix = new math_gl__WEBPACK_IMPORTED_MODULE_0__["Matrix3"]();
  var scratchUnitary = new math_gl__WEBPACK_IMPORTED_MODULE_0__["Matrix3"]();
  var scratchDiagonal = new math_gl__WEBPACK_IMPORTED_MODULE_0__["Matrix3"]();
  var jMatrix = new math_gl__WEBPACK_IMPORTED_MODULE_0__["Matrix3"]();
  var jMatrixTranspose = new math_gl__WEBPACK_IMPORTED_MODULE_0__["Matrix3"]();
  function computeEigenDecomposition(matrix) {
    var result = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
    var EIGEN_TOLERANCE = math_gl__WEBPACK_IMPORTED_MODULE_0__["_MathUtils"].EPSILON20;
    var EIGEN_MAX_SWEEPS = 10;
    var count = 0;
    var sweep = 0;
    var unitaryMatrix = scratchUnitary;
    var diagonalMatrix = scratchDiagonal;
    unitaryMatrix.identity();
    diagonalMatrix.copy(matrix);
    var epsilon = EIGEN_TOLERANCE * computeFrobeniusNorm(diagonalMatrix);
  
    while (sweep < EIGEN_MAX_SWEEPS && offDiagonalFrobeniusNorm(diagonalMatrix) > epsilon) {
      shurDecomposition(diagonalMatrix, jMatrix);
      jMatrixTranspose.copy(jMatrix).transpose();
      diagonalMatrix.multiplyRight(jMatrix);
      diagonalMatrix.multiplyLeft(jMatrixTranspose);
      unitaryMatrix.multiplyRight(jMatrix);
  
      if (++count > 2) {
        ++sweep;
        count = 0;
      }
    }
  
    result.unitary = unitaryMatrix.toTarget(result.unitary);
    result.diagonal = diagonalMatrix.toTarget(result.diagonal);
    return result;
  }
  
  function computeFrobeniusNorm(matrix) {
    var norm = 0.0;
  
    for (var i = 0; i < 9; ++i) {
      var temp = matrix[i];
      norm += temp * temp;
    }
  
    return Math.sqrt(norm);
  }
  
  var rowVal = [1, 0, 0];
  var colVal = [2, 2, 1];
  
  function offDiagonalFrobeniusNorm(matrix) {
    var norm = 0.0;
  
    for (var i = 0; i < 3; ++i) {
      var temp = matrix[scratchMatrix.getElementIndex(colVal[i], rowVal[i])];
      norm += 2.0 * temp * temp;
    }
  
    return Math.sqrt(norm);
  }
  
  function shurDecomposition(matrix, result) {
    var tolerance = math_gl__WEBPACK_IMPORTED_MODULE_0__["_MathUtils"].EPSILON15;
    var maxDiagonal = 0.0;
    var rotAxis = 1;
  
    for (var i = 0; i < 3; ++i) {
      var temp = Math.abs(matrix[scratchMatrix.getElementIndex(colVal[i], rowVal[i])]);
  
      if (temp > maxDiagonal) {
        rotAxis = i;
        maxDiagonal = temp;
      }
    }
  
    var p = rowVal[rotAxis];
    var q = colVal[rotAxis];
    var c = 1.0;
    var s = 0.0;
  
    if (Math.abs(matrix[scratchMatrix.getElementIndex(q, p)]) > tolerance) {
      var qq = matrix[scratchMatrix.getElementIndex(q, q)];
      var pp = matrix[scratchMatrix.getElementIndex(p, p)];
      var qp = matrix[scratchMatrix.getElementIndex(q, p)];
      var tau = (qq - pp) / 2.0 / qp;
      var t;
  
      if (tau < 0.0) {
        t = -1.0 / (-tau + Math.sqrt(1.0 + tau * tau));
      } else {
        t = 1.0 / (tau + Math.sqrt(1.0 + tau * tau));
      }
  
      c = 1.0 / Math.sqrt(1.0 + t * t);
      s = t * c;
    }
  
    math_gl__WEBPACK_IMPORTED_MODULE_0__["Matrix3"].IDENTITY.to(result);
    result[scratchMatrix.getElementIndex(p, p)] = result[scratchMatrix.getElementIndex(q, q)] = c;
    result[scratchMatrix.getElementIndex(q, p)] = s;
    result[scratchMatrix.getElementIndex(p, q)] = -s;
    return result;
  }
  //# sourceMappingURL=compute-eigen-decomposition.js.map
  
  /***/ }),
  
  /***/ "../../node_modules/@math.gl/culling/dist/esm/constants.js":
  /*!*****************************************************************************************!*\
    !*** /Users/xintong/dev/loaders.gl/node_modules/@math.gl/culling/dist/esm/constants.js ***!
    \*****************************************************************************************/
  /*! exports provided: INTERSECT, Intersect */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "INTERSECT", function() { return INTERSECT; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Intersect", function() { return Intersect; });
  var INTERSECT = Object.freeze({
    OUTSIDE: -1,
    INTERSECTING: 0,
    INSIDE: 1
  });
  var Intersect = INTERSECT;
  //# sourceMappingURL=constants.js.map
  
  /***/ }),
  
  /***/ "../../node_modules/@math.gl/culling/dist/esm/index.js":
  /*!*************************************************************************************!*\
    !*** /Users/xintong/dev/loaders.gl/node_modules/@math.gl/culling/dist/esm/index.js ***!
    \*************************************************************************************/
  /*! exports provided: INTERSECT, Intersect, AxisAlignedBoundingBox, BoundingSphere, OrientedBoundingBox, CullingVolume, Plane, _PerspectiveOffCenterFrustum, _PerspectiveFrustum, makeBoundingSphereFromPoints */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constants */ "../../node_modules/@math.gl/culling/dist/esm/constants.js");
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "INTERSECT", function() { return _constants__WEBPACK_IMPORTED_MODULE_0__["INTERSECT"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Intersect", function() { return _constants__WEBPACK_IMPORTED_MODULE_0__["INTERSECT"]; });
  
  /* harmony import */ var _lib_axis_aligned_bounding_box__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./lib/axis-aligned-bounding-box */ "../../node_modules/@math.gl/culling/dist/esm/lib/axis-aligned-bounding-box.js");
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AxisAlignedBoundingBox", function() { return _lib_axis_aligned_bounding_box__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  
  /* harmony import */ var _lib_bounding_sphere__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./lib/bounding-sphere */ "../../node_modules/@math.gl/culling/dist/esm/lib/bounding-sphere.js");
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BoundingSphere", function() { return _lib_bounding_sphere__WEBPACK_IMPORTED_MODULE_2__["default"]; });
  
  /* harmony import */ var _lib_oriented_bounding_box__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./lib/oriented-bounding-box */ "../../node_modules/@math.gl/culling/dist/esm/lib/oriented-bounding-box.js");
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "OrientedBoundingBox", function() { return _lib_oriented_bounding_box__WEBPACK_IMPORTED_MODULE_3__["default"]; });
  
  /* harmony import */ var _lib_culling_volume__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./lib/culling-volume */ "../../node_modules/@math.gl/culling/dist/esm/lib/culling-volume.js");
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CullingVolume", function() { return _lib_culling_volume__WEBPACK_IMPORTED_MODULE_4__["default"]; });
  
  /* harmony import */ var _lib_plane__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./lib/plane */ "../../node_modules/@math.gl/culling/dist/esm/lib/plane.js");
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Plane", function() { return _lib_plane__WEBPACK_IMPORTED_MODULE_5__["default"]; });
  
  /* harmony import */ var _lib_perspective_off_center_frustum__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./lib/perspective-off-center-frustum */ "../../node_modules/@math.gl/culling/dist/esm/lib/perspective-off-center-frustum.js");
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_PerspectiveOffCenterFrustum", function() { return _lib_perspective_off_center_frustum__WEBPACK_IMPORTED_MODULE_6__["default"]; });
  
  /* harmony import */ var _lib_perspective_frustum__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./lib/perspective-frustum */ "../../node_modules/@math.gl/culling/dist/esm/lib/perspective-frustum.js");
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_PerspectiveFrustum", function() { return _lib_perspective_frustum__WEBPACK_IMPORTED_MODULE_7__["default"]; });
  
  /* harmony import */ var _algorithms_bounding_sphere_from_points__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./algorithms/bounding-sphere-from-points */ "../../node_modules/@math.gl/culling/dist/esm/algorithms/bounding-sphere-from-points.js");
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "makeBoundingSphereFromPoints", function() { return _algorithms_bounding_sphere_from_points__WEBPACK_IMPORTED_MODULE_8__["makeBoundingSphereFromPoints"]; });
  
  
  
  
  
  
  
  
  
  
  
  //# sourceMappingURL=index.js.map
  
  /***/ }),
  
  /***/ "../../node_modules/@math.gl/culling/dist/esm/lib/axis-aligned-bounding-box.js":
  /*!*************************************************************************************************************!*\
    !*** /Users/xintong/dev/loaders.gl/node_modules/@math.gl/culling/dist/esm/lib/axis-aligned-bounding-box.js ***!
    \*************************************************************************************************************/
  /*! exports provided: default */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return AxisAlignedBoundingBox; });
  /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "../../node_modules/@babel/runtime/helpers/esm/classCallCheck.js");
  /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "../../node_modules/@babel/runtime/helpers/esm/createClass.js");
  /* harmony import */ var math_gl__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! math.gl */ "../../node_modules/math.gl/dist/esm/index.js");
  /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../constants */ "../../node_modules/@math.gl/culling/dist/esm/constants.js");
  
  
  
  
  var scratchVector = new math_gl__WEBPACK_IMPORTED_MODULE_2__["Vector3"]();
  var scratchNormal = new math_gl__WEBPACK_IMPORTED_MODULE_2__["Vector3"]();
  
  var AxisAlignedBoundingBox = function () {
    function AxisAlignedBoundingBox() {
      var minimum = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [0, 0, 0];
      var maximum = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [0, 0, 0];
      var center = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
  
      Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, AxisAlignedBoundingBox);
  
      center = center || scratchVector.copy(minimum).add(maximum).scale(0.5);
      this.minimum = new math_gl__WEBPACK_IMPORTED_MODULE_2__["Vector3"](minimum);
      this.maximum = new math_gl__WEBPACK_IMPORTED_MODULE_2__["Vector3"](maximum);
      this.center = new math_gl__WEBPACK_IMPORTED_MODULE_2__["Vector3"](center);
    }
  
    Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(AxisAlignedBoundingBox, [{
      key: "fromPoints",
      value: function fromPoints(positions) {
        if (!positions || positions.length === 0) {
          this.minimum.set(0, 0, 0);
          this.maximum.set(0, 0, 0);
          this.center.set(0, 0, 0);
          return this;
        }
  
        var minimumX = positions[0][0];
        var minimumY = positions[0][1];
        var minimumZ = positions[0][2];
        var maximumX = positions[0][0];
        var maximumY = positions[0][1];
        var maximumZ = positions[0][2];
        var _iteratorNormalCompletion = true;
        var _didIteratorError = false;
        var _iteratorError = undefined;
  
        try {
          for (var _iterator = positions[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
            var p = _step.value;
            var x = p[0];
            var y = p[1];
            var z = p[2];
            minimumX = Math.min(x, minimumX);
            maximumX = Math.max(x, maximumX);
            minimumY = Math.min(y, minimumY);
            maximumY = Math.max(y, maximumY);
            minimumZ = Math.min(z, minimumZ);
            maximumZ = Math.max(z, maximumZ);
          }
        } catch (err) {
          _didIteratorError = true;
          _iteratorError = err;
        } finally {
          try {
            if (!_iteratorNormalCompletion && _iterator["return"] != null) {
              _iterator["return"]();
            }
          } finally {
            if (_didIteratorError) {
              throw _iteratorError;
            }
          }
        }
  
        this.minimum.set(minimumX, minimumY, minimumZ);
        this.maximum.set(maximumX, maximumY, maximumZ);
        this.center.copy(this.minimum).add(this.maximum).scale(0.5);
        return this;
      }
    }, {
      key: "clone",
      value: function clone() {
        return new AxisAlignedBoundingBox(this.minimum, this.maximum, this.center);
      }
    }, {
      key: "equals",
      value: function equals(right) {
        return this === right || Boolean(right) && this.center.equals(right.center) && this.minimum.equals(right.minimum) && this.maximum.equals(right.maximum);
      }
    }, {
      key: "intersectPlane",
      value: function intersectPlane(plane) {
        var h = scratchVector.copy(this.maximum).subtract(this.minimum).scale(0.5);
        var normal = scratchNormal.from(plane.normal);
        var e = h.x * Math.abs(normal.x) + h.y * Math.abs(normal.y) + h.z * Math.abs(normal.z);
        var s = this.center.dot(normal) + plane.distance;
  
        if (s - e > 0) {
          return _constants__WEBPACK_IMPORTED_MODULE_3__["Intersect"].INSIDE;
        }
  
        if (s + e < 0) {
          return _constants__WEBPACK_IMPORTED_MODULE_3__["Intersect"].OUTSIDE;
        }
  
        return _constants__WEBPACK_IMPORTED_MODULE_3__["Intersect"].INTERSECTING;
      }
    }]);
  
    return AxisAlignedBoundingBox;
  }();
  
  
  //# sourceMappingURL=axis-aligned-bounding-box.js.map
  
  /***/ }),
  
  /***/ "../../node_modules/@math.gl/culling/dist/esm/lib/bounding-sphere.js":
  /*!***************************************************************************************************!*\
    !*** /Users/xintong/dev/loaders.gl/node_modules/@math.gl/culling/dist/esm/lib/bounding-sphere.js ***!
    \***************************************************************************************************/
  /*! exports provided: default */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return BoundingSphere; });
  /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "../../node_modules/@babel/runtime/helpers/esm/classCallCheck.js");
  /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "../../node_modules/@babel/runtime/helpers/esm/createClass.js");
  /* harmony import */ var math_gl__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! math.gl */ "../../node_modules/math.gl/dist/esm/index.js");
  /* harmony import */ var gl_matrix_mat4__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! gl-matrix/mat4 */ "../../node_modules/gl-matrix/esm/mat4.js");
  /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../constants */ "../../node_modules/@math.gl/culling/dist/esm/constants.js");
  
  
  
  
  
  var scratchVector = new math_gl__WEBPACK_IMPORTED_MODULE_2__["Vector3"]();
  var scratchVector2 = new math_gl__WEBPACK_IMPORTED_MODULE_2__["Vector3"]();
  
  var BoundingSphere = function () {
    function BoundingSphere() {
      var center = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [0, 0, 0];
      var radius = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0.0;
  
      Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, BoundingSphere);
  
      this.radius = -0;
      this.center = new math_gl__WEBPACK_IMPORTED_MODULE_2__["Vector3"]();
      this.fromCenterRadius(center, radius);
    }
  
    Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(BoundingSphere, [{
      key: "fromCenterRadius",
      value: function fromCenterRadius(center, radius) {
        this.center.from(center);
        this.radius = radius;
        return this;
      }
    }, {
      key: "fromCornerPoints",
      value: function fromCornerPoints(corner, oppositeCorner) {
        oppositeCorner = scratchVector.from(oppositeCorner);
        this.center = new math_gl__WEBPACK_IMPORTED_MODULE_2__["Vector3"]().from(corner).add(oppositeCorner).scale(0.5);
        this.radius = this.center.distance(oppositeCorner);
        return this;
      }
    }, {
      key: "equals",
      value: function equals(right) {
        return this === right || Boolean(right) && this.center.equals(right.center) && this.radius === right.radius;
      }
    }, {
      key: "clone",
      value: function clone() {
        return new BoundingSphere(this.center, this.radius);
      }
    }, {
      key: "union",
      value: function union(boundingSphere) {
        var leftCenter = this.center;
        var leftRadius = this.radius;
        var rightCenter = boundingSphere.center;
        var rightRadius = boundingSphere.radius;
        var toRightCenter = scratchVector.copy(rightCenter).subtract(leftCenter);
        var centerSeparation = toRightCenter.magnitude();
  
        if (leftRadius >= centerSeparation + rightRadius) {
          return this.clone();
        }
  
        if (rightRadius >= centerSeparation + leftRadius) {
          return boundingSphere.clone();
        }
  
        var halfDistanceBetweenTangentPoints = (leftRadius + centerSeparation + rightRadius) * 0.5;
        scratchVector2.copy(toRightCenter).scale((-leftRadius + halfDistanceBetweenTangentPoints) / centerSeparation).add(leftCenter);
        this.center.copy(scratchVector2);
        this.radius = halfDistanceBetweenTangentPoints;
        return this;
      }
    }, {
      key: "expand",
      value: function expand(point) {
        point = scratchVector.from(point);
        var radius = point.subtract(this.center).magnitude();
  
        if (radius > this.radius) {
          this.radius = radius;
        }
  
        return this;
      }
    }, {
      key: "intersectPlane",
      value: function intersectPlane(plane) {
        var center = this.center;
        var radius = this.radius;
        var normal = plane.normal;
        var distanceToPlane = normal.dot(center) + plane.distance;
  
        if (distanceToPlane < -radius) {
          return _constants__WEBPACK_IMPORTED_MODULE_4__["Intersect"].OUTSIDE;
        }
  
        if (distanceToPlane < radius) {
          return _constants__WEBPACK_IMPORTED_MODULE_4__["Intersect"].INTERSECTING;
        }
  
        return _constants__WEBPACK_IMPORTED_MODULE_4__["Intersect"].INSIDE;
      }
    }, {
      key: "transform",
      value: function transform(_transform) {
        this.center.transform(_transform);
        var scale = gl_matrix_mat4__WEBPACK_IMPORTED_MODULE_3__["getScaling"](scratchVector, _transform);
        this.radius = Math.max(scale[0], Math.max(scale[1], scale[2])) * this.radius;
        return this;
      }
    }, {
      key: "distanceSquaredTo",
      value: function distanceSquaredTo(point) {
        point = scratchVector.from(point);
        var delta = point.subtract(this.center);
        return delta.lengthSquared() - this.radius * this.radius;
      }
    }, {
      key: "distanceTo",
      value: function distanceTo(point) {
        return Math.sqrt(this.distanceSquaredTo(point));
      }
    }]);
  
    return BoundingSphere;
  }();
  
  
  //# sourceMappingURL=bounding-sphere.js.map
  
  /***/ }),
  
  /***/ "../../node_modules/@math.gl/culling/dist/esm/lib/culling-volume.js":
  /*!**************************************************************************************************!*\
    !*** /Users/xintong/dev/loaders.gl/node_modules/@math.gl/culling/dist/esm/lib/culling-volume.js ***!
    \**************************************************************************************************/
  /*! exports provided: default */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return CullingVolume; });
  /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "../../node_modules/@babel/runtime/helpers/esm/classCallCheck.js");
  /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "../../node_modules/@babel/runtime/helpers/esm/createClass.js");
  /* harmony import */ var math_gl__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! math.gl */ "../../node_modules/math.gl/dist/esm/index.js");
  /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../constants */ "../../node_modules/@math.gl/culling/dist/esm/constants.js");
  /* harmony import */ var _plane__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./plane */ "../../node_modules/@math.gl/culling/dist/esm/lib/plane.js");
  
  
  
  
  
  var faces = [new math_gl__WEBPACK_IMPORTED_MODULE_2__["Vector3"]([1, 0, 0]), new math_gl__WEBPACK_IMPORTED_MODULE_2__["Vector3"]([0, 1, 0]), new math_gl__WEBPACK_IMPORTED_MODULE_2__["Vector3"]([0, 0, 1])];
  var scratchPlaneCenter = new math_gl__WEBPACK_IMPORTED_MODULE_2__["Vector3"]();
  var scratchPlaneNormal = new math_gl__WEBPACK_IMPORTED_MODULE_2__["Vector3"]();
  var scratchPlane = new _plane__WEBPACK_IMPORTED_MODULE_4__["default"](new math_gl__WEBPACK_IMPORTED_MODULE_2__["Vector3"](1.0, 0.0, 0.0), 0.0);
  
  var CullingVolume = function () {
    Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(CullingVolume, null, [{
      key: "MASK_OUTSIDE",
      get: function get() {
        return 0xffffffff;
      }
    }, {
      key: "MASK_INSIDE",
      get: function get() {
        return 0x00000000;
      }
    }, {
      key: "MASK_INDETERMINATE",
      get: function get() {
        return 0x7fffffff;
      }
    }]);
  
    function CullingVolume() {
      var planes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  
      Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, CullingVolume);
  
      this.planes = planes;
      Object(math_gl__WEBPACK_IMPORTED_MODULE_2__["assert"])(this.planes.every(function (plane) {
        return plane instanceof _plane__WEBPACK_IMPORTED_MODULE_4__["default"];
      }));
    }
  
    Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(CullingVolume, [{
      key: "fromBoundingSphere",
      value: function fromBoundingSphere(boundingSphere) {
        this.planes.length = 2 * faces.length;
        var center = boundingSphere.center;
        var radius = boundingSphere.radius;
        var planeIndex = 0;
        var _iteratorNormalCompletion = true;
        var _didIteratorError = false;
        var _iteratorError = undefined;
  
        try {
          for (var _iterator = faces[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
            var faceNormal = _step.value;
            var plane0 = this.planes[planeIndex];
            var plane1 = this.planes[planeIndex + 1];
  
            if (!plane0) {
              plane0 = this.planes[planeIndex] = new _plane__WEBPACK_IMPORTED_MODULE_4__["default"]();
            }
  
            if (!plane1) {
              plane1 = this.planes[planeIndex + 1] = new _plane__WEBPACK_IMPORTED_MODULE_4__["default"]();
            }
  
            var plane0Center = scratchPlaneCenter.copy(faceNormal).scale(-radius).add(center);
            var plane0Distance = -faceNormal.dot(plane0Center);
            plane0.fromPointNormal(plane0Center, faceNormal);
            var plane1Center = scratchPlaneCenter.copy(faceNormal).scale(radius).add(center);
            var negatedFaceNormal = scratchPlaneNormal.copy(faceNormal).negate();
            var plane1Distance = -negatedFaceNormal.dot(plane1Center);
            plane1.fromPointNormal(plane1Center, negatedFaceNormal);
            planeIndex += 2;
          }
        } catch (err) {
          _didIteratorError = true;
          _iteratorError = err;
        } finally {
          try {
            if (!_iteratorNormalCompletion && _iterator["return"] != null) {
              _iterator["return"]();
            }
          } finally {
            if (_didIteratorError) {
              throw _iteratorError;
            }
          }
        }
  
        return this;
      }
    }, {
      key: "computeVisibility",
      value: function computeVisibility(boundingVolume) {
        Object(math_gl__WEBPACK_IMPORTED_MODULE_2__["assert"])(boundingVolume);
        var intersect = _constants__WEBPACK_IMPORTED_MODULE_3__["Intersect"].INSIDE;
        var _iteratorNormalCompletion2 = true;
        var _didIteratorError2 = false;
        var _iteratorError2 = undefined;
  
        try {
          for (var _iterator2 = this.planes[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
            var plane = _step2.value;
            var result = boundingVolume.intersectPlane(plane);
  
            switch (result) {
              case _constants__WEBPACK_IMPORTED_MODULE_3__["Intersect"].OUTSIDE:
                return _constants__WEBPACK_IMPORTED_MODULE_3__["Intersect"].OUTSIDE;
  
              case _constants__WEBPACK_IMPORTED_MODULE_3__["Intersect"].INTERSECTING:
                intersect = _constants__WEBPACK_IMPORTED_MODULE_3__["Intersect"].INTERSECTING;
                break;
  
              default:
            }
          }
        } catch (err) {
          _didIteratorError2 = true;
          _iteratorError2 = err;
        } finally {
          try {
            if (!_iteratorNormalCompletion2 && _iterator2["return"] != null) {
              _iterator2["return"]();
            }
          } finally {
            if (_didIteratorError2) {
              throw _iteratorError2;
            }
          }
        }
  
        return intersect;
      }
    }, {
      key: "computeVisibilityWithPlaneMask",
      value: function computeVisibilityWithPlaneMask(boundingVolume, parentPlaneMask) {
        Object(math_gl__WEBPACK_IMPORTED_MODULE_2__["assert"])(boundingVolume, 'boundingVolume is required.');
        Object(math_gl__WEBPACK_IMPORTED_MODULE_2__["assert"])(Number.isFinite(parentPlaneMask), 'parentPlaneMask is required.');
  
        if (parentPlaneMask === CullingVolume.MASK_OUTSIDE || parentPlaneMask === CullingVolume.MASK_INSIDE) {
          return parentPlaneMask;
        }
  
        var mask = CullingVolume.MASK_INSIDE;
        var planes = this.planes;
  
        for (var k = 0; k < this.planes.length; ++k) {
          var flag = k < 31 ? 1 << k : 0;
  
          if (k < 31 && (parentPlaneMask & flag) === 0) {
            continue;
          }
  
          var plane = planes[k];
          var result = boundingVolume.intersectPlane(plane);
  
          if (result === _constants__WEBPACK_IMPORTED_MODULE_3__["Intersect"].OUTSIDE) {
            return CullingVolume.MASK_OUTSIDE;
          } else if (result === _constants__WEBPACK_IMPORTED_MODULE_3__["Intersect"].INTERSECTING) {
            mask |= flag;
          }
        }
  
        return mask;
      }
    }]);
  
    return CullingVolume;
  }();
  
  
  //# sourceMappingURL=culling-volume.js.map
  
  /***/ }),
  
  /***/ "../../node_modules/@math.gl/culling/dist/esm/lib/oriented-bounding-box.js":
  /*!*********************************************************************************************************!*\
    !*** /Users/xintong/dev/loaders.gl/node_modules/@math.gl/culling/dist/esm/lib/oriented-bounding-box.js ***!
    \*********************************************************************************************************/
  /*! exports provided: default */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return OrientedBoundingBox; });
  /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "../../node_modules/@babel/runtime/helpers/esm/classCallCheck.js");
  /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "../../node_modules/@babel/runtime/helpers/esm/createClass.js");
  /* harmony import */ var math_gl__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! math.gl */ "../../node_modules/math.gl/dist/esm/index.js");
  /* harmony import */ var _bounding_sphere__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./bounding-sphere */ "../../node_modules/@math.gl/culling/dist/esm/lib/bounding-sphere.js");
  /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../constants */ "../../node_modules/@math.gl/culling/dist/esm/constants.js");
  /* harmony import */ var _algorithms_bounding_box_from_points__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../algorithms/bounding-box-from-points */ "../../node_modules/@math.gl/culling/dist/esm/algorithms/bounding-box-from-points.js");
  
  
  
  
  
  
  var scratchVector = new math_gl__WEBPACK_IMPORTED_MODULE_2__["Vector3"]();
  var scratchOffset = new math_gl__WEBPACK_IMPORTED_MODULE_2__["Vector3"]();
  var scratchVectorU = new math_gl__WEBPACK_IMPORTED_MODULE_2__["Vector3"]();
  var scratchVectorV = new math_gl__WEBPACK_IMPORTED_MODULE_2__["Vector3"]();
  var scratchVectorW = new math_gl__WEBPACK_IMPORTED_MODULE_2__["Vector3"]();
  var scratchPPrime = new math_gl__WEBPACK_IMPORTED_MODULE_2__["Vector3"]();
  var scratchCorner = new math_gl__WEBPACK_IMPORTED_MODULE_2__["Vector3"]();
  var scratchToCenter = new math_gl__WEBPACK_IMPORTED_MODULE_2__["Vector3"]();
  var fromOrientedBoundingBoxScratchU = new math_gl__WEBPACK_IMPORTED_MODULE_2__["Vector3"]();
  var fromOrientedBoundingBoxScratchV = new math_gl__WEBPACK_IMPORTED_MODULE_2__["Vector3"]();
  var fromOrientedBoundingBoxScratchW = new math_gl__WEBPACK_IMPORTED_MODULE_2__["Vector3"]();
  var MATRIX3 = {
    COLUMN0ROW0: 0,
    COLUMN0ROW1: 1,
    COLUMN0ROW2: 2,
    COLUMN1ROW0: 3,
    COLUMN1ROW1: 4,
    COLUMN1ROW2: 5,
    COLUMN2ROW0: 6,
    COLUMN2ROW1: 7,
    COLUMN2ROW2: 8
  };
  
  var OrientedBoundingBox = function () {
    function OrientedBoundingBox() {
      var center = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [0, 0, 0];
      var halfAxes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [0, 0, 0, 0, 0, 0, 0, 0, 0];
  
      Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, OrientedBoundingBox);
  
      this.center = new math_gl__WEBPACK_IMPORTED_MODULE_2__["Vector3"]().from(center);
      this.halfAxes = new math_gl__WEBPACK_IMPORTED_MODULE_2__["Matrix3"](halfAxes);
    }
  
    Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(OrientedBoundingBox, [{
      key: "clone",
      value: function clone(result) {
        return new OrientedBoundingBox(this.center, this.halfAxes);
      }
    }, {
      key: "fromPoints",
      value: function fromPoints(points) {
        var result = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : new OrientedBoundingBox();
        return Object(_algorithms_bounding_box_from_points__WEBPACK_IMPORTED_MODULE_5__["default"])(points, result);
      }
    }, {
      key: "equals",
      value: function equals(right) {
        return this === right || Boolean(right) && this.center.equals(right.center) && this.halfAxes.equals(right.halfAxes);
      }
    }, {
      key: "getBoundingSphere",
      value: function getBoundingSphere() {
        var result = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new _bounding_sphere__WEBPACK_IMPORTED_MODULE_3__["default"]();
        var halfAxes = this.halfAxes;
        var u = halfAxes.getColumn(0, fromOrientedBoundingBoxScratchU);
        var v = halfAxes.getColumn(1, fromOrientedBoundingBoxScratchV);
        var w = halfAxes.getColumn(2, fromOrientedBoundingBoxScratchW);
        var cornerVector = scratchVector.copy(u).add(v).add(w);
        result.center.copy(this.center);
        result.radius = cornerVector.magnitude();
        return result;
      }
    }, {
      key: "intersectPlane",
      value: function intersectPlane(plane) {
        var center = this.center;
        var normal = plane.normal;
        var halfAxes = this.halfAxes;
        var normalX = normal.x;
        var normalY = normal.y;
        var normalZ = normal.z;
        var radEffective = Math.abs(normalX * halfAxes[MATRIX3.COLUMN0ROW0] + normalY * halfAxes[MATRIX3.COLUMN0ROW1] + normalZ * halfAxes[MATRIX3.COLUMN0ROW2]) + Math.abs(normalX * halfAxes[MATRIX3.COLUMN1ROW0] + normalY * halfAxes[MATRIX3.COLUMN1ROW1] + normalZ * halfAxes[MATRIX3.COLUMN1ROW2]) + Math.abs(normalX * halfAxes[MATRIX3.COLUMN2ROW0] + normalY * halfAxes[MATRIX3.COLUMN2ROW1] + normalZ * halfAxes[MATRIX3.COLUMN2ROW2]);
        var distanceToPlane = normal.dot(center) + plane.distance;
  
        if (distanceToPlane <= -radEffective) {
          return _constants__WEBPACK_IMPORTED_MODULE_4__["Intersect"].OUTSIDE;
        } else if (distanceToPlane >= radEffective) {
          return _constants__WEBPACK_IMPORTED_MODULE_4__["Intersect"].INSIDE;
        }
  
        return _constants__WEBPACK_IMPORTED_MODULE_4__["Intersect"].INTERSECTING;
      }
    }, {
      key: "distanceTo",
      value: function distanceTo(point) {
        return Math.sqrt(this.distanceSquaredTo(point));
      }
    }, {
      key: "distanceSquaredTo",
      value: function distanceSquaredTo(point) {
        var offset = scratchOffset.from(point).subtract(this.center);
        var halfAxes = this.halfAxes;
        var u = halfAxes.getColumn(0, scratchVectorU);
        var v = halfAxes.getColumn(1, scratchVectorV);
        var w = halfAxes.getColumn(2, scratchVectorW);
        var uHalf = u.magnitude();
        var vHalf = v.magnitude();
        var wHalf = w.magnitude();
        u.normalize();
        v.normalize();
        w.normalize();
        var pPrime = scratchPPrime;
        pPrime.x = offset.dot(u);
        pPrime.y = offset.dot(v);
        pPrime.z = offset.dot(w);
        var distanceSquared = 0.0;
        var d;
  
        if (pPrime.x < -uHalf) {
          d = pPrime.x + uHalf;
          distanceSquared += d * d;
        } else if (pPrime.x > uHalf) {
          d = pPrime.x - uHalf;
          distanceSquared += d * d;
        }
  
        if (pPrime.y < -vHalf) {
          d = pPrime.y + vHalf;
          distanceSquared += d * d;
        } else if (pPrime.y > vHalf) {
          d = pPrime.y - vHalf;
          distanceSquared += d * d;
        }
  
        if (pPrime.z < -wHalf) {
          d = pPrime.z + wHalf;
          distanceSquared += d * d;
        } else if (pPrime.z > wHalf) {
          d = pPrime.z - wHalf;
          distanceSquared += d * d;
        }
  
        return distanceSquared;
      }
    }, {
      key: "computePlaneDistances",
      value: function computePlaneDistances(position, direction) {
        var result = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [[], []];
        var minDist = Number.POSITIVE_INFINITY;
        var maxDist = Number.NEGATIVE_INFINITY;
        var center = this.center;
        var halfAxes = this.halfAxes;
        var u = halfAxes.getColumn(0, scratchVectorU);
        var v = halfAxes.getColumn(1, scratchVectorV);
        var w = halfAxes.getColumn(2, scratchVectorW);
        var corner = scratchCorner.copy(u).add(v).add(w).add(center);
        var toCenter = scratchToCenter.copy(corner).subtract(position);
        var mag = direction.dot(toCenter);
        minDist = Math.min(mag, minDist);
        maxDist = Math.max(mag, maxDist);
        corner.copy(center).add(u).add(v).subtract(w);
        toCenter.copy(corner).subtract(position);
        mag = direction.dot(toCenter);
        minDist = Math.min(mag, minDist);
        maxDist = Math.max(mag, maxDist);
        corner.copy(center).add(u).subtract(v).add(w);
        toCenter.copy(corner).subtract(position);
        mag = direction.dot(toCenter);
        minDist = Math.min(mag, minDist);
        maxDist = Math.max(mag, maxDist);
        corner.copy(center).add(u).subtract(v).subtract(w);
        toCenter.copy(corner).subtract(position);
        mag = direction.dot(toCenter);
        minDist = Math.min(mag, minDist);
        maxDist = Math.max(mag, maxDist);
        center.copy(corner).subtract(u).add(v).add(w);
        toCenter.copy(corner).subtract(position);
        mag = direction.dot(toCenter);
        minDist = Math.min(mag, minDist);
        maxDist = Math.max(mag, maxDist);
        center.copy(corner).subtract(u).add(v).subtract(w);
        toCenter.copy(corner).subtract(position);
        mag = direction.dot(toCenter);
        minDist = Math.min(mag, minDist);
        maxDist = Math.max(mag, maxDist);
        center.copy(corner).subtract(u).subtract(v).add(w);
        toCenter.copy(corner).subtract(position);
        mag = direction.dot(toCenter);
        minDist = Math.min(mag, minDist);
        maxDist = Math.max(mag, maxDist);
        center.copy(corner).subtract(u).subtract(v).subtract(w);
        toCenter.copy(corner).subtract(position);
        mag = direction.dot(toCenter);
        minDist = Math.min(mag, minDist);
        maxDist = Math.max(mag, maxDist);
        result.start = minDist;
        result.stop = maxDist;
        return result;
      }
    }, {
      key: "getTransform",
      value: function getTransform() {}
    }]);
  
    return OrientedBoundingBox;
  }();
  
  
  //# sourceMappingURL=oriented-bounding-box.js.map
  
  /***/ }),
  
  /***/ "../../node_modules/@math.gl/culling/dist/esm/lib/perspective-frustum.js":
  /*!*******************************************************************************************************!*\
    !*** /Users/xintong/dev/loaders.gl/node_modules/@math.gl/culling/dist/esm/lib/perspective-frustum.js ***!
    \*******************************************************************************************************/
  /*! exports provided: default */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return PerspectiveFrustum; });
  /* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/defineProperty */ "../../node_modules/@babel/runtime/helpers/esm/defineProperty.js");
  /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "../../node_modules/@babel/runtime/helpers/esm/classCallCheck.js");
  /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "../../node_modules/@babel/runtime/helpers/esm/createClass.js");
  /* harmony import */ var math_gl__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! math.gl */ "../../node_modules/math.gl/dist/esm/index.js");
  /* harmony import */ var _perspective_off_center_frustum__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./perspective-off-center-frustum */ "../../node_modules/@math.gl/culling/dist/esm/lib/perspective-off-center-frustum.js");
  
  
  
  
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
  
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
  
  
  
  
  var defined = function defined(val) {
    return val !== null && typeof val !== 'undefined';
  };
  
  var PerspectiveFrustum = function () {
    function PerspectiveFrustum() {
      var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  
      Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__["default"])(this, PerspectiveFrustum);
  
      options = _objectSpread({
        near: 1.0,
        far: 500000000.0,
        xOffset: 0.0,
        yOffset: 0.0
      }, options);
      this._offCenterFrustum = new _perspective_off_center_frustum__WEBPACK_IMPORTED_MODULE_4__["default"]();
      this.fov = options.fov;
      this._fov = undefined;
      this._fovy = undefined;
      this._sseDenominator = undefined;
      this.aspectRatio = options.aspectRatio;
      this._aspectRatio = undefined;
      this.near = options.near;
      this._near = this.near;
      this.far = options.far;
      this._far = this.far;
      this.xOffset = options.xOffset;
      this._xOffset = this.xOffset;
      this.yOffset = options.yOffset;
      this._yOffset = this.yOffset;
    }
  
    Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__["default"])(PerspectiveFrustum, [{
      key: "clone",
      value: function clone() {
        return new PerspectiveFrustum({
          aspectRatio: this.aspectRatio,
          fov: this.fov,
          near: this.near,
          far: this.far
        });
      }
    }, {
      key: "equals",
      value: function equals(other) {
        if (!defined(other) || !(other instanceof PerspectiveFrustum)) {
          return false;
        }
  
        update(this);
        update(other);
        return this.fov === other.fov && this.aspectRatio === other.aspectRatio && this.near === other.near && this.far === other.far && this._offCenterFrustum.equals(other._offCenterFrustum);
      }
    }, {
      key: "computeCullingVolume",
      value: function computeCullingVolume(position, direction, up) {
        update(this);
        return this._offCenterFrustum.computeCullingVolume(position, direction, up);
      }
    }, {
      key: "getPixelDimensions",
      value: function getPixelDimensions(drawingBufferWidth, drawingBufferHeight, distance, result) {
        update(this);
        return this._offCenterFrustum.getPixelDimensions(drawingBufferWidth, drawingBufferHeight, distance, result);
      }
    }, {
      key: "projectionMatrix",
      get: function get() {
        update(this);
        return this._offCenterFrustum.projectionMatrix;
      }
    }, {
      key: "infiniteProjectionMatrix",
      get: function get() {
        update(this);
        return this._offCenterFrustum.infiniteProjectionMatrix;
      }
    }, {
      key: "fovy",
      get: function get() {
        update(this);
        return this._fovy;
      }
    }, {
      key: "sseDenominator",
      get: function get() {
        update(this);
        return this._sseDenominator;
      }
    }]);
  
    return PerspectiveFrustum;
  }();
  
  
  
  function update(frustum) {
    Object(math_gl__WEBPACK_IMPORTED_MODULE_3__["assert"])(Number.isFinite(frustum.fov) && Number.isFinite(frustum.aspectRatio) && Number.isFinite(frustum.near) && Number.isFinite(frustum.far));
    var f = frustum._offCenterFrustum;
  
    if (frustum.fov !== frustum._fov || frustum.aspectRatio !== frustum._aspectRatio || frustum.near !== frustum._near || frustum.far !== frustum._far || frustum.xOffset !== frustum._xOffset || frustum.yOffset !== frustum._yOffset) {
      Object(math_gl__WEBPACK_IMPORTED_MODULE_3__["assert"])(frustum.fov >= 0 && frustum.fov < Math.PI);
      Object(math_gl__WEBPACK_IMPORTED_MODULE_3__["assert"])(frustum.aspectRatio > 0);
      Object(math_gl__WEBPACK_IMPORTED_MODULE_3__["assert"])(frustum.near >= 0 && frustum.near < frustum.far);
      frustum._aspectRatio = frustum.aspectRatio;
      frustum._fov = frustum.fov;
      frustum._fovy = frustum.aspectRatio <= 1 ? frustum.fov : Math.atan(Math.tan(frustum.fov * 0.5) / frustum.aspectRatio) * 2.0;
      frustum._near = frustum.near;
      frustum._far = frustum.far;
      frustum._sseDenominator = 2.0 * Math.tan(0.5 * frustum._fovy);
      frustum._xOffset = frustum.xOffset;
      frustum._yOffset = frustum.yOffset;
      f.top = frustum.near * Math.tan(0.5 * frustum._fovy);
      f.bottom = -f.top;
      f.right = frustum.aspectRatio * f.top;
      f.left = -f.right;
      f.near = frustum.near;
      f.far = frustum.far;
      f.right += frustum.xOffset;
      f.left += frustum.xOffset;
      f.top += frustum.yOffset;
      f.bottom += frustum.yOffset;
    }
  }
  //# sourceMappingURL=perspective-frustum.js.map
  
  /***/ }),
  
  /***/ "../../node_modules/@math.gl/culling/dist/esm/lib/perspective-off-center-frustum.js":
  /*!******************************************************************************************************************!*\
    !*** /Users/xintong/dev/loaders.gl/node_modules/@math.gl/culling/dist/esm/lib/perspective-off-center-frustum.js ***!
    \******************************************************************************************************************/
  /*! exports provided: default */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return PerspectiveOffCenterFrustum; });
  /* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/defineProperty */ "../../node_modules/@babel/runtime/helpers/esm/defineProperty.js");
  /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "../../node_modules/@babel/runtime/helpers/esm/classCallCheck.js");
  /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "../../node_modules/@babel/runtime/helpers/esm/createClass.js");
  /* harmony import */ var math_gl__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! math.gl */ "../../node_modules/math.gl/dist/esm/index.js");
  /* harmony import */ var _culling_volume__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./culling-volume */ "../../node_modules/@math.gl/culling/dist/esm/lib/culling-volume.js");
  /* harmony import */ var _plane__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./plane */ "../../node_modules/@math.gl/culling/dist/esm/lib/plane.js");
  
  
  
  
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
  
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
  
  
  
  
  var scratchPlaneUpVector = new math_gl__WEBPACK_IMPORTED_MODULE_3__["Vector3"]();
  var scratchPlaneRightVector = new math_gl__WEBPACK_IMPORTED_MODULE_3__["Vector3"]();
  var scratchPlaneNearCenter = new math_gl__WEBPACK_IMPORTED_MODULE_3__["Vector3"]();
  var scratchPlaneFarCenter = new math_gl__WEBPACK_IMPORTED_MODULE_3__["Vector3"]();
  var scratchPlaneNormal = new math_gl__WEBPACK_IMPORTED_MODULE_3__["Vector3"]();
  
  var PerspectiveOffCenterFrustum = function () {
    function PerspectiveOffCenterFrustum() {
      var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  
      Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__["default"])(this, PerspectiveOffCenterFrustum);
  
      options = _objectSpread({
        near: 1.0,
        far: 500000000.0
      }, options);
      this.left = options.left;
      this._left = undefined;
      this.right = options.right;
      this._right = undefined;
      this.top = options.top;
      this._top = undefined;
      this.bottom = options.bottom;
      this._bottom = undefined;
      this.near = options.near;
      this._near = this.near;
      this.far = options.far;
      this._far = this.far;
      this._cullingVolume = new _culling_volume__WEBPACK_IMPORTED_MODULE_4__["default"]([new _plane__WEBPACK_IMPORTED_MODULE_5__["default"](), new _plane__WEBPACK_IMPORTED_MODULE_5__["default"](), new _plane__WEBPACK_IMPORTED_MODULE_5__["default"](), new _plane__WEBPACK_IMPORTED_MODULE_5__["default"](), new _plane__WEBPACK_IMPORTED_MODULE_5__["default"](), new _plane__WEBPACK_IMPORTED_MODULE_5__["default"]()]);
      this._perspectiveMatrix = new math_gl__WEBPACK_IMPORTED_MODULE_3__["Matrix4"]();
      this._infinitePerspective = new math_gl__WEBPACK_IMPORTED_MODULE_3__["Matrix4"]();
    }
  
    Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__["default"])(PerspectiveOffCenterFrustum, [{
      key: "clone",
      value: function clone() {
        return new PerspectiveOffCenterFrustum({
          right: this.right,
          left: this.left,
          top: this.top,
          bottom: this.bottom,
          near: this.near,
          far: this.far
        });
      }
    }, {
      key: "equals",
      value: function equals(other) {
        return other && other instanceof PerspectiveOffCenterFrustum && this.right === other.right && this.left === other.left && this.top === other.top && this.bottom === other.bottom && this.near === other.near && this.far === other.far;
      }
    }, {
      key: "computeCullingVolume",
      value: function computeCullingVolume(position, direction, up) {
        Object(math_gl__WEBPACK_IMPORTED_MODULE_3__["assert"])(position, 'position is required.');
        Object(math_gl__WEBPACK_IMPORTED_MODULE_3__["assert"])(direction, 'direction is required.');
        Object(math_gl__WEBPACK_IMPORTED_MODULE_3__["assert"])(up, 'up is required.');
        var planes = this._cullingVolume.planes;
        up = scratchPlaneUpVector.copy(up).normalize();
        var right = scratchPlaneRightVector.copy(direction).cross(up).normalize();
        var nearCenter = scratchPlaneNearCenter.copy(direction).multiplyByScalar(this.near).add(position);
        var farCenter = scratchPlaneFarCenter.copy(direction).multiplyByScalar(this.far).add(position);
        var normal = scratchPlaneNormal;
        normal.copy(right).multiplyByScalar(this.left).add(nearCenter).subtract(position).cross(up);
        planes[0].fromPointNormal(position, normal);
        normal.copy(right).multiplyByScalar(this.right).add(nearCenter).subtract(position).cross(up).negate();
        planes[1].fromPointNormal(position, normal);
        normal.copy(up).multiplyByScalar(this.bottom).add(nearCenter).subtract(position).cross(right).negate();
        planes[2].fromPointNormal(position, normal);
        normal.copy(up).multiplyByScalar(this.top).add(nearCenter).subtract(position).cross(right);
        planes[3].fromPointNormal(position, normal);
        normal = new math_gl__WEBPACK_IMPORTED_MODULE_3__["Vector3"]().copy(direction);
        planes[4].fromPointNormal(nearCenter, normal);
        normal.negate();
        planes[5].fromPointNormal(farCenter, normal);
        return this._cullingVolume;
      }
    }, {
      key: "getPixelDimensions",
      value: function getPixelDimensions(drawingBufferWidth, drawingBufferHeight, distance, result) {
        update(this);
        Object(math_gl__WEBPACK_IMPORTED_MODULE_3__["assert"])(Number.isFinite(drawingBufferWidth) && Number.isFinite(drawingBufferHeight));
        Object(math_gl__WEBPACK_IMPORTED_MODULE_3__["assert"])(drawingBufferWidth > 0);
        Object(math_gl__WEBPACK_IMPORTED_MODULE_3__["assert"])(drawingBufferHeight > 0);
        Object(math_gl__WEBPACK_IMPORTED_MODULE_3__["assert"])(distance > 0);
        Object(math_gl__WEBPACK_IMPORTED_MODULE_3__["assert"])(result);
        var inverseNear = 1.0 / this.near;
        var tanTheta = this.top * inverseNear;
        var pixelHeight = 2.0 * distance * tanTheta / drawingBufferHeight;
        tanTheta = this.right * inverseNear;
        var pixelWidth = 2.0 * distance * tanTheta / drawingBufferWidth;
        result.x = pixelWidth;
        result.y = pixelHeight;
        return result;
      }
    }, {
      key: "projectionMatrix",
      get: function get() {
        update(this);
        return this._perspectiveMatrix;
      }
    }, {
      key: "infiniteProjectionMatrix",
      get: function get() {
        update(this);
        return this._infinitePerspective;
      }
    }]);
  
    return PerspectiveOffCenterFrustum;
  }();
  
  
  
  function update(frustum) {
    Object(math_gl__WEBPACK_IMPORTED_MODULE_3__["assert"])(Number.isFinite(frustum.right) && Number.isFinite(frustum.left) && Number.isFinite(frustum.top) && Number.isFinite(frustum.bottom) && Number.isFinite(frustum.near) && Number.isFinite(frustum.far));
    var top = frustum.top,
        bottom = frustum.bottom,
        right = frustum.right,
        left = frustum.left,
        near = frustum.near,
        far = frustum.far;
  
    if (top !== frustum._top || bottom !== frustum._bottom || left !== frustum._left || right !== frustum._right || near !== frustum._near || far !== frustum._far) {
      Object(math_gl__WEBPACK_IMPORTED_MODULE_3__["assert"])(frustum.near > 0 && frustum.near < frustum.far, 'near must be greater than zero and less than far.');
      frustum._left = left;
      frustum._right = right;
      frustum._top = top;
      frustum._bottom = bottom;
      frustum._near = near;
      frustum._far = far;
      frustum._perspectiveMatrix = new math_gl__WEBPACK_IMPORTED_MODULE_3__["Matrix4"]().frustum({
        left: left,
        right: right,
        bottom: bottom,
        top: top,
        near: near,
        far: far
      });
      frustum._infinitePerspective = new math_gl__WEBPACK_IMPORTED_MODULE_3__["Matrix4"]().frustum({
        left: left,
        right: right,
        bottom: bottom,
        top: top,
        near: near,
        far: Infinity
      });
    }
  }
  //# sourceMappingURL=perspective-off-center-frustum.js.map
  
  /***/ }),
  
  /***/ "../../node_modules/@math.gl/culling/dist/esm/lib/plane.js":
  /*!*****************************************************************************************!*\
    !*** /Users/xintong/dev/loaders.gl/node_modules/@math.gl/culling/dist/esm/lib/plane.js ***!
    \*****************************************************************************************/
  /*! exports provided: default */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Plane; });
  /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "../../node_modules/@babel/runtime/helpers/esm/classCallCheck.js");
  /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "../../node_modules/@babel/runtime/helpers/esm/createClass.js");
  /* harmony import */ var math_gl__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! math.gl */ "../../node_modules/math.gl/dist/esm/index.js");
  
  
  
  var scratchPosition = new math_gl__WEBPACK_IMPORTED_MODULE_2__["Vector3"]();
  var scratchNormal = new math_gl__WEBPACK_IMPORTED_MODULE_2__["Vector3"]();
  
  var Plane = function () {
    function Plane() {
      var normal = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [0, 0, 1];
      var distance = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  
      Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, Plane);
  
      this.normal = new math_gl__WEBPACK_IMPORTED_MODULE_2__["Vector3"]();
      this.distance = -0;
      this.fromNormalDistance(normal, distance);
    }
  
    Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(Plane, [{
      key: "fromNormalDistance",
      value: function fromNormalDistance(normal, distance) {
        Object(math_gl__WEBPACK_IMPORTED_MODULE_2__["assert"])(Number.isFinite(distance));
        this.normal.from(normal).normalize();
        this.distance = distance;
        return this;
      }
    }, {
      key: "fromPointNormal",
      value: function fromPointNormal(point, normal) {
        point = scratchPosition.from(point);
        this.normal.from(normal).normalize();
        var distance = -this.normal.dot(point);
        this.distance = distance;
        return this;
      }
    }, {
      key: "fromCoefficients",
      value: function fromCoefficients(a, b, c, d) {
        this.normal.set(a, b, c);
        Object(math_gl__WEBPACK_IMPORTED_MODULE_2__["assert"])(Object(math_gl__WEBPACK_IMPORTED_MODULE_2__["equals"])(this.normal.len(), 1));
        this.distance = d;
        return this;
      }
    }, {
      key: "clone",
      value: function clone(plane) {
        return new Plane(this.normal, this.distance);
      }
    }, {
      key: "equals",
      value: function equals(right) {
        return Object(math_gl__WEBPACK_IMPORTED_MODULE_2__["equals"])(this.distance, right.distance) && Object(math_gl__WEBPACK_IMPORTED_MODULE_2__["equals"])(this.normal, right.normal);
      }
    }, {
      key: "getPointDistance",
      value: function getPointDistance(point) {
        return this.normal.dot(point) + this.distance;
      }
    }, {
      key: "transform",
      value: function transform(matrix4) {
        var normal = scratchNormal.copy(this.normal).transformAsVector(matrix4).normalize();
        var point = this.normal.scale(-this.distance).transform(matrix4);
        return this.fromPointNormal(point, normal);
      }
    }, {
      key: "projectPointOntoPlane",
      value: function projectPointOntoPlane(point) {
        var result = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [0, 0, 0];
        point = scratchPosition.from(point);
        var pointDistance = this.getPointDistance(point);
        var scaledNormal = scratchNormal.copy(this.normal).scale(pointDistance);
        return point.subtract(scaledNormal).to(result);
      }
    }]);
  
    return Plane;
  }();
  
  
  //# sourceMappingURL=plane.js.map
  
  /***/ }),
  
  /***/ "../../node_modules/@probe.gl/stats/dist/esm/index.js":
  /*!************************************************************************************!*\
    !*** /Users/xintong/dev/loaders.gl/node_modules/@probe.gl/stats/dist/esm/index.js ***!
    \************************************************************************************/
  /*! exports provided: Stats, Stat, _getHiResTimestamp */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony import */ var _lib_stats__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./lib/stats */ "../../node_modules/@probe.gl/stats/dist/esm/lib/stats.js");
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Stats", function() { return _lib_stats__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  
  /* harmony import */ var _lib_stat__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./lib/stat */ "../../node_modules/@probe.gl/stats/dist/esm/lib/stat.js");
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Stat", function() { return _lib_stat__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  
  /* harmony import */ var _utils_hi_res_timestamp__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils/hi-res-timestamp */ "../../node_modules/@probe.gl/stats/dist/esm/utils/hi-res-timestamp.js");
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_getHiResTimestamp", function() { return _utils_hi_res_timestamp__WEBPACK_IMPORTED_MODULE_2__["default"]; });
  
  
  
  
  //# sourceMappingURL=index.js.map
  
  /***/ }),
  
  /***/ "../../node_modules/@probe.gl/stats/dist/esm/lib/stat.js":
  /*!***************************************************************************************!*\
    !*** /Users/xintong/dev/loaders.gl/node_modules/@probe.gl/stats/dist/esm/lib/stat.js ***!
    \***************************************************************************************/
  /*! exports provided: default */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Stat; });
  /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "../../node_modules/@babel/runtime/helpers/esm/classCallCheck.js");
  /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "../../node_modules/@babel/runtime/helpers/esm/createClass.js");
  /* harmony import */ var _utils_hi_res_timestamp__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/hi-res-timestamp */ "../../node_modules/@probe.gl/stats/dist/esm/utils/hi-res-timestamp.js");
  
  
  
  
  var Stat = function () {
    function Stat(name, type) {
      Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, Stat);
  
      this.name = name;
      this.type = type;
      this.sampleSize = 1;
      this.reset();
    }
  
    Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(Stat, [{
      key: "setSampleSize",
      value: function setSampleSize(samples) {
        this.sampleSize = samples;
        return this;
      }
    }, {
      key: "incrementCount",
      value: function incrementCount() {
        this.addCount(1);
        return this;
      }
    }, {
      key: "decrementCount",
      value: function decrementCount() {
        this.subtractCount(1);
        return this;
      }
    }, {
      key: "addCount",
      value: function addCount(value) {
        this._count += value;
        this._samples++;
  
        this._checkSampling();
  
        return this;
      }
    }, {
      key: "subtractCount",
      value: function subtractCount(value) {
        this._count -= value;
        this._samples++;
  
        this._checkSampling();
  
        return this;
      }
    }, {
      key: "addTime",
      value: function addTime(time) {
        this._time += time;
        this.lastTiming = time;
        this._samples++;
  
        this._checkSampling();
  
        return this;
      }
    }, {
      key: "timeStart",
      value: function timeStart() {
        this._startTime = Object(_utils_hi_res_timestamp__WEBPACK_IMPORTED_MODULE_2__["default"])();
        this._timerPending = true;
        return this;
      }
    }, {
      key: "timeEnd",
      value: function timeEnd() {
        if (!this._timerPending) {
          return this;
        }
  
        this.addTime(Object(_utils_hi_res_timestamp__WEBPACK_IMPORTED_MODULE_2__["default"])() - this._startTime);
        this._timerPending = false;
  
        this._checkSampling();
  
        return this;
      }
    }, {
      key: "getSampleAverageCount",
      value: function getSampleAverageCount() {
        return this.sampleSize > 0 ? this.lastSampleCount / this.sampleSize : 0;
      }
    }, {
      key: "getSampleAverageTime",
      value: function getSampleAverageTime() {
        return this.sampleSize > 0 ? this.lastSampleTime / this.sampleSize : 0;
      }
    }, {
      key: "getSampleHz",
      value: function getSampleHz() {
        return this.lastSampleTime > 0 ? this.sampleSize / (this.lastSampleTime / 1000) : 0;
      }
    }, {
      key: "getAverageCount",
      value: function getAverageCount() {
        return this.samples > 0 ? this.count / this.samples : 0;
      }
    }, {
      key: "getAverageTime",
      value: function getAverageTime() {
        return this.samples > 0 ? this.time / this.samples : 0;
      }
    }, {
      key: "getHz",
      value: function getHz() {
        return this.time > 0 ? this.samples / (this.time / 1000) : 0;
      }
    }, {
      key: "reset",
      value: function reset() {
        this.time = 0;
        this.count = 0;
        this.samples = 0;
        this.lastTiming = 0;
        this.lastSampleTime = 0;
        this.lastSampleCount = 0;
        this._count = 0;
        this._time = 0;
        this._samples = 0;
        this._startTime = 0;
        this._timerPending = false;
        return this;
      }
    }, {
      key: "_checkSampling",
      value: function _checkSampling() {
        if (this._samples === this.sampleSize) {
          this.lastSampleTime = this._time;
          this.lastSampleCount = this._count;
          this.count += this._count;
          this.time += this._time;
          this.samples += this._samples;
          this._time = 0;
          this._count = 0;
          this._samples = 0;
        }
      }
    }]);
  
    return Stat;
  }();
  
  
  //# sourceMappingURL=stat.js.map
  
  /***/ }),
  
  /***/ "../../node_modules/@probe.gl/stats/dist/esm/lib/stats.js":
  /*!****************************************************************************************!*\
    !*** /Users/xintong/dev/loaders.gl/node_modules/@probe.gl/stats/dist/esm/lib/stats.js ***!
    \****************************************************************************************/
  /*! exports provided: default */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Stats; });
  /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "../../node_modules/@babel/runtime/helpers/esm/classCallCheck.js");
  /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "../../node_modules/@babel/runtime/helpers/esm/createClass.js");
  /* harmony import */ var _stat__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./stat */ "../../node_modules/@probe.gl/stats/dist/esm/lib/stat.js");
  
  
  
  
  var Stats = function () {
    function Stats(_ref) {
      var id = _ref.id,
          stats = _ref.stats;
  
      Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, Stats);
  
      this.id = id;
      this.stats = {};
  
      this._initializeStats(stats);
  
      Object.seal(this);
    }
  
    Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(Stats, [{
      key: "get",
      value: function get(name) {
        var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'count';
        return this._getOrCreate({
          name: name,
          type: type
        });
      }
    }, {
      key: "reset",
      value: function reset() {
        for (var key in this.stats) {
          this.stats[key].reset();
        }
  
        return this;
      }
    }, {
      key: "forEach",
      value: function forEach(fn) {
        for (var key in this.stats) {
          fn(this.stats[key]);
        }
      }
    }, {
      key: "getTable",
      value: function getTable() {
        var table = {};
        this.forEach(function (stat) {
          table[stat.name] = {
            time: stat.time || 0,
            count: stat.count || 0,
            average: stat.getAverageTime() || 0,
            hz: stat.getHz() || 0
          };
        });
        return table;
      }
    }, {
      key: "_initializeStats",
      value: function _initializeStats() {
        var _this = this;
  
        var stats = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
        stats.forEach(function (stat) {
          return _this._getOrCreate(stat);
        });
      }
    }, {
      key: "_getOrCreate",
      value: function _getOrCreate(stat) {
        if (!stat || !stat.name) {
          return null;
        }
  
        var name = stat.name,
            type = stat.type;
  
        if (!this.stats[name]) {
          if (stat instanceof _stat__WEBPACK_IMPORTED_MODULE_2__["default"]) {
            this.stats[name] = stat;
          } else {
            this.stats[name] = new _stat__WEBPACK_IMPORTED_MODULE_2__["default"](name, type);
          }
        }
  
        return this.stats[name];
      }
    }, {
      key: "size",
      get: function get() {
        return Object.keys(this.stats).length;
      }
    }]);
  
    return Stats;
  }();
  
  
  //# sourceMappingURL=stats.js.map
  
  /***/ }),
  
  /***/ "../../node_modules/@probe.gl/stats/dist/esm/utils/hi-res-timestamp.js":
  /*!*****************************************************************************************************!*\
    !*** /Users/xintong/dev/loaders.gl/node_modules/@probe.gl/stats/dist/esm/utils/hi-res-timestamp.js ***!
    \*****************************************************************************************************/
  /*! exports provided: default */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* WEBPACK VAR INJECTION */(function(process) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return getHiResTimestamp; });
  function getHiResTimestamp() {
    var timestamp;
  
    if (typeof window !== 'undefined' && window.performance) {
      timestamp = window.performance.now();
    } else if (typeof process !== 'undefined' && process.hrtime) {
      var timeParts = process.hrtime();
      timestamp = timeParts[0] * 1000 + timeParts[1] / 1e6;
    } else {
      timestamp = Date.now();
    }
  
    return timestamp;
  }
  //# sourceMappingURL=hi-res-timestamp.js.map
  /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../process/browser.js */ "../../node_modules/process/browser.js")))
  
  /***/ }),
  
  /***/ "../../node_modules/gl-matrix/esm/common.js":
  /*!**************************************************************************!*\
    !*** /Users/xintong/dev/loaders.gl/node_modules/gl-matrix/esm/common.js ***!
    \**************************************************************************/
  /*! exports provided: EPSILON, ARRAY_TYPE, RANDOM, setMatrixArrayType, toRadian, equals */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EPSILON", function() { return EPSILON; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ARRAY_TYPE", function() { return ARRAY_TYPE; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RANDOM", function() { return RANDOM; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setMatrixArrayType", function() { return setMatrixArrayType; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toRadian", function() { return toRadian; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "equals", function() { return equals; });
  /**
   * Common utilities
   * @module glMatrix
   */
  // Configuration Constants
  var EPSILON = 0.000001;
  var ARRAY_TYPE = typeof Float32Array !== 'undefined' ? Float32Array : Array;
  var RANDOM = Math.random;
  /**
   * Sets the type of array used when creating new vectors and matrices
   *
   * @param {Type} type Array type, such as Float32Array or Array
   */
  
  function setMatrixArrayType(type) {
    ARRAY_TYPE = type;
  }
  var degree = Math.PI / 180;
  /**
   * Convert Degree To Radian
   *
   * @param {Number} a Angle in Degrees
   */
  
  function toRadian(a) {
    return a * degree;
  }
  /**
   * Tests whether or not the arguments have approximately the same value, within an absolute
   * or relative tolerance of glMatrix.EPSILON (an absolute tolerance is used for values less
   * than or equal to 1.0, and a relative tolerance is used for larger values)
   *
   * @param {Number} a The first number to test.
   * @param {Number} b The second number to test.
   * @returns {Boolean} True if the numbers are approximately equal, false otherwise.
   */
  
  function equals(a, b) {
    return Math.abs(a - b) <= EPSILON * Math.max(1.0, Math.abs(a), Math.abs(b));
  }
  if (!Math.hypot) Math.hypot = function () {
    var y = 0,
        i = arguments.length;
  
    while (i--) {
      y += arguments[i] * arguments[i];
    }
  
    return Math.sqrt(y);
  };
  
  /***/ }),
  
  /***/ "../../node_modules/gl-matrix/esm/mat3.js":
  /*!************************************************************************!*\
    !*** /Users/xintong/dev/loaders.gl/node_modules/gl-matrix/esm/mat3.js ***!
    \************************************************************************/
  /*! exports provided: create, fromMat4, clone, copy, fromValues, set, identity, transpose, invert, adjoint, determinant, multiply, translate, rotate, scale, fromTranslation, fromRotation, fromScaling, fromMat2d, fromQuat, normalFromMat4, projection, str, frob, add, subtract, multiplyScalar, multiplyScalarAndAdd, exactEquals, equals, mul, sub */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "create", function() { return create; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromMat4", function() { return fromMat4; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "clone", function() { return clone; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "copy", function() { return copy; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromValues", function() { return fromValues; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "set", function() { return set; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "identity", function() { return identity; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "transpose", function() { return transpose; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "invert", function() { return invert; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "adjoint", function() { return adjoint; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "determinant", function() { return determinant; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "multiply", function() { return multiply; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "translate", function() { return translate; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rotate", function() { return rotate; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scale", function() { return scale; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromTranslation", function() { return fromTranslation; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromRotation", function() { return fromRotation; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromScaling", function() { return fromScaling; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromMat2d", function() { return fromMat2d; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromQuat", function() { return fromQuat; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalFromMat4", function() { return normalFromMat4; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "projection", function() { return projection; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "str", function() { return str; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "frob", function() { return frob; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "add", function() { return add; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "subtract", function() { return subtract; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "multiplyScalar", function() { return multiplyScalar; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "multiplyScalarAndAdd", function() { return multiplyScalarAndAdd; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "exactEquals", function() { return exactEquals; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "equals", function() { return equals; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mul", function() { return mul; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sub", function() { return sub; });
  /* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common.js */ "../../node_modules/gl-matrix/esm/common.js");
  
  /**
   * 3x3 Matrix
   * @module mat3
   */
  
  /**
   * Creates a new identity mat3
   *
   * @returns {mat3} a new 3x3 matrix
   */
  
  function create() {
    var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"](9);
  
    if (_common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"] != Float32Array) {
      out[1] = 0;
      out[2] = 0;
      out[3] = 0;
      out[5] = 0;
      out[6] = 0;
      out[7] = 0;
    }
  
    out[0] = 1;
    out[4] = 1;
    out[8] = 1;
    return out;
  }
  /**
   * Copies the upper-left 3x3 values into the given mat3.
   *
   * @param {mat3} out the receiving 3x3 matrix
   * @param {mat4} a   the source 4x4 matrix
   * @returns {mat3} out
   */
  
  function fromMat4(out, a) {
    out[0] = a[0];
    out[1] = a[1];
    out[2] = a[2];
    out[3] = a[4];
    out[4] = a[5];
    out[5] = a[6];
    out[6] = a[8];
    out[7] = a[9];
    out[8] = a[10];
    return out;
  }
  /**
   * Creates a new mat3 initialized with values from an existing matrix
   *
   * @param {mat3} a matrix to clone
   * @returns {mat3} a new 3x3 matrix
   */
  
  function clone(a) {
    var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"](9);
    out[0] = a[0];
    out[1] = a[1];
    out[2] = a[2];
    out[3] = a[3];
    out[4] = a[4];
    out[5] = a[5];
    out[6] = a[6];
    out[7] = a[7];
    out[8] = a[8];
    return out;
  }
  /**
   * Copy the values from one mat3 to another
   *
   * @param {mat3} out the receiving matrix
   * @param {mat3} a the source matrix
   * @returns {mat3} out
   */
  
  function copy(out, a) {
    out[0] = a[0];
    out[1] = a[1];
    out[2] = a[2];
    out[3] = a[3];
    out[4] = a[4];
    out[5] = a[5];
    out[6] = a[6];
    out[7] = a[7];
    out[8] = a[8];
    return out;
  }
  /**
   * Create a new mat3 with the given values
   *
   * @param {Number} m00 Component in column 0, row 0 position (index 0)
   * @param {Number} m01 Component in column 0, row 1 position (index 1)
   * @param {Number} m02 Component in column 0, row 2 position (index 2)
   * @param {Number} m10 Component in column 1, row 0 position (index 3)
   * @param {Number} m11 Component in column 1, row 1 position (index 4)
   * @param {Number} m12 Component in column 1, row 2 position (index 5)
   * @param {Number} m20 Component in column 2, row 0 position (index 6)
   * @param {Number} m21 Component in column 2, row 1 position (index 7)
   * @param {Number} m22 Component in column 2, row 2 position (index 8)
   * @returns {mat3} A new mat3
   */
  
  function fromValues(m00, m01, m02, m10, m11, m12, m20, m21, m22) {
    var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"](9);
    out[0] = m00;
    out[1] = m01;
    out[2] = m02;
    out[3] = m10;
    out[4] = m11;
    out[5] = m12;
    out[6] = m20;
    out[7] = m21;
    out[8] = m22;
    return out;
  }
  /**
   * Set the components of a mat3 to the given values
   *
   * @param {mat3} out the receiving matrix
   * @param {Number} m00 Component in column 0, row 0 position (index 0)
   * @param {Number} m01 Component in column 0, row 1 position (index 1)
   * @param {Number} m02 Component in column 0, row 2 position (index 2)
   * @param {Number} m10 Component in column 1, row 0 position (index 3)
   * @param {Number} m11 Component in column 1, row 1 position (index 4)
   * @param {Number} m12 Component in column 1, row 2 position (index 5)
   * @param {Number} m20 Component in column 2, row 0 position (index 6)
   * @param {Number} m21 Component in column 2, row 1 position (index 7)
   * @param {Number} m22 Component in column 2, row 2 position (index 8)
   * @returns {mat3} out
   */
  
  function set(out, m00, m01, m02, m10, m11, m12, m20, m21, m22) {
    out[0] = m00;
    out[1] = m01;
    out[2] = m02;
    out[3] = m10;
    out[4] = m11;
    out[5] = m12;
    out[6] = m20;
    out[7] = m21;
    out[8] = m22;
    return out;
  }
  /**
   * Set a mat3 to the identity matrix
   *
   * @param {mat3} out the receiving matrix
   * @returns {mat3} out
   */
  
  function identity(out) {
    out[0] = 1;
    out[1] = 0;
    out[2] = 0;
    out[3] = 0;
    out[4] = 1;
    out[5] = 0;
    out[6] = 0;
    out[7] = 0;
    out[8] = 1;
    return out;
  }
  /**
   * Transpose the values of a mat3
   *
   * @param {mat3} out the receiving matrix
   * @param {mat3} a the source matrix
   * @returns {mat3} out
   */
  
  function transpose(out, a) {
    // If we are transposing ourselves we can skip a few steps but have to cache some values
    if (out === a) {
      var a01 = a[1],
          a02 = a[2],
          a12 = a[5];
      out[1] = a[3];
      out[2] = a[6];
      out[3] = a01;
      out[5] = a[7];
      out[6] = a02;
      out[7] = a12;
    } else {
      out[0] = a[0];
      out[1] = a[3];
      out[2] = a[6];
      out[3] = a[1];
      out[4] = a[4];
      out[5] = a[7];
      out[6] = a[2];
      out[7] = a[5];
      out[8] = a[8];
    }
  
    return out;
  }
  /**
   * Inverts a mat3
   *
   * @param {mat3} out the receiving matrix
   * @param {mat3} a the source matrix
   * @returns {mat3} out
   */
  
  function invert(out, a) {
    var a00 = a[0],
        a01 = a[1],
        a02 = a[2];
    var a10 = a[3],
        a11 = a[4],
        a12 = a[5];
    var a20 = a[6],
        a21 = a[7],
        a22 = a[8];
    var b01 = a22 * a11 - a12 * a21;
    var b11 = -a22 * a10 + a12 * a20;
    var b21 = a21 * a10 - a11 * a20; // Calculate the determinant
  
    var det = a00 * b01 + a01 * b11 + a02 * b21;
  
    if (!det) {
      return null;
    }
  
    det = 1.0 / det;
    out[0] = b01 * det;
    out[1] = (-a22 * a01 + a02 * a21) * det;
    out[2] = (a12 * a01 - a02 * a11) * det;
    out[3] = b11 * det;
    out[4] = (a22 * a00 - a02 * a20) * det;
    out[5] = (-a12 * a00 + a02 * a10) * det;
    out[6] = b21 * det;
    out[7] = (-a21 * a00 + a01 * a20) * det;
    out[8] = (a11 * a00 - a01 * a10) * det;
    return out;
  }
  /**
   * Calculates the adjugate of a mat3
   *
   * @param {mat3} out the receiving matrix
   * @param {mat3} a the source matrix
   * @returns {mat3} out
   */
  
  function adjoint(out, a) {
    var a00 = a[0],
        a01 = a[1],
        a02 = a[2];
    var a10 = a[3],
        a11 = a[4],
        a12 = a[5];
    var a20 = a[6],
        a21 = a[7],
        a22 = a[8];
    out[0] = a11 * a22 - a12 * a21;
    out[1] = a02 * a21 - a01 * a22;
    out[2] = a01 * a12 - a02 * a11;
    out[3] = a12 * a20 - a10 * a22;
    out[4] = a00 * a22 - a02 * a20;
    out[5] = a02 * a10 - a00 * a12;
    out[6] = a10 * a21 - a11 * a20;
    out[7] = a01 * a20 - a00 * a21;
    out[8] = a00 * a11 - a01 * a10;
    return out;
  }
  /**
   * Calculates the determinant of a mat3
   *
   * @param {mat3} a the source matrix
   * @returns {Number} determinant of a
   */
  
  function determinant(a) {
    var a00 = a[0],
        a01 = a[1],
        a02 = a[2];
    var a10 = a[3],
        a11 = a[4],
        a12 = a[5];
    var a20 = a[6],
        a21 = a[7],
        a22 = a[8];
    return a00 * (a22 * a11 - a12 * a21) + a01 * (-a22 * a10 + a12 * a20) + a02 * (a21 * a10 - a11 * a20);
  }
  /**
   * Multiplies two mat3's
   *
   * @param {mat3} out the receiving matrix
   * @param {mat3} a the first operand
   * @param {mat3} b the second operand
   * @returns {mat3} out
   */
  
  function multiply(out, a, b) {
    var a00 = a[0],
        a01 = a[1],
        a02 = a[2];
    var a10 = a[3],
        a11 = a[4],
        a12 = a[5];
    var a20 = a[6],
        a21 = a[7],
        a22 = a[8];
    var b00 = b[0],
        b01 = b[1],
        b02 = b[2];
    var b10 = b[3],
        b11 = b[4],
        b12 = b[5];
    var b20 = b[6],
        b21 = b[7],
        b22 = b[8];
    out[0] = b00 * a00 + b01 * a10 + b02 * a20;
    out[1] = b00 * a01 + b01 * a11 + b02 * a21;
    out[2] = b00 * a02 + b01 * a12 + b02 * a22;
    out[3] = b10 * a00 + b11 * a10 + b12 * a20;
    out[4] = b10 * a01 + b11 * a11 + b12 * a21;
    out[5] = b10 * a02 + b11 * a12 + b12 * a22;
    out[6] = b20 * a00 + b21 * a10 + b22 * a20;
    out[7] = b20 * a01 + b21 * a11 + b22 * a21;
    out[8] = b20 * a02 + b21 * a12 + b22 * a22;
    return out;
  }
  /**
   * Translate a mat3 by the given vector
   *
   * @param {mat3} out the receiving matrix
   * @param {mat3} a the matrix to translate
   * @param {vec2} v vector to translate by
   * @returns {mat3} out
   */
  
  function translate(out, a, v) {
    var a00 = a[0],
        a01 = a[1],
        a02 = a[2],
        a10 = a[3],
        a11 = a[4],
        a12 = a[5],
        a20 = a[6],
        a21 = a[7],
        a22 = a[8],
        x = v[0],
        y = v[1];
    out[0] = a00;
    out[1] = a01;
    out[2] = a02;
    out[3] = a10;
    out[4] = a11;
    out[5] = a12;
    out[6] = x * a00 + y * a10 + a20;
    out[7] = x * a01 + y * a11 + a21;
    out[8] = x * a02 + y * a12 + a22;
    return out;
  }
  /**
   * Rotates a mat3 by the given angle
   *
   * @param {mat3} out the receiving matrix
   * @param {mat3} a the matrix to rotate
   * @param {Number} rad the angle to rotate the matrix by
   * @returns {mat3} out
   */
  
  function rotate(out, a, rad) {
    var a00 = a[0],
        a01 = a[1],
        a02 = a[2],
        a10 = a[3],
        a11 = a[4],
        a12 = a[5],
        a20 = a[6],
        a21 = a[7],
        a22 = a[8],
        s = Math.sin(rad),
        c = Math.cos(rad);
    out[0] = c * a00 + s * a10;
    out[1] = c * a01 + s * a11;
    out[2] = c * a02 + s * a12;
    out[3] = c * a10 - s * a00;
    out[4] = c * a11 - s * a01;
    out[5] = c * a12 - s * a02;
    out[6] = a20;
    out[7] = a21;
    out[8] = a22;
    return out;
  }
  ;
  /**
   * Scales the mat3 by the dimensions in the given vec2
   *
   * @param {mat3} out the receiving matrix
   * @param {mat3} a the matrix to rotate
   * @param {vec2} v the vec2 to scale the matrix by
   * @returns {mat3} out
   **/
  
  function scale(out, a, v) {
    var x = v[0],
        y = v[1];
    out[0] = x * a[0];
    out[1] = x * a[1];
    out[2] = x * a[2];
    out[3] = y * a[3];
    out[4] = y * a[4];
    out[5] = y * a[5];
    out[6] = a[6];
    out[7] = a[7];
    out[8] = a[8];
    return out;
  }
  /**
   * Creates a matrix from a vector translation
   * This is equivalent to (but much faster than):
   *
   *     mat3.identity(dest);
   *     mat3.translate(dest, dest, vec);
   *
   * @param {mat3} out mat3 receiving operation result
   * @param {vec2} v Translation vector
   * @returns {mat3} out
   */
  
  function fromTranslation(out, v) {
    out[0] = 1;
    out[1] = 0;
    out[2] = 0;
    out[3] = 0;
    out[4] = 1;
    out[5] = 0;
    out[6] = v[0];
    out[7] = v[1];
    out[8] = 1;
    return out;
  }
  /**
   * Creates a matrix from a given angle
   * This is equivalent to (but much faster than):
   *
   *     mat3.identity(dest);
   *     mat3.rotate(dest, dest, rad);
   *
   * @param {mat3} out mat3 receiving operation result
   * @param {Number} rad the angle to rotate the matrix by
   * @returns {mat3} out
   */
  
  function fromRotation(out, rad) {
    var s = Math.sin(rad),
        c = Math.cos(rad);
    out[0] = c;
    out[1] = s;
    out[2] = 0;
    out[3] = -s;
    out[4] = c;
    out[5] = 0;
    out[6] = 0;
    out[7] = 0;
    out[8] = 1;
    return out;
  }
  /**
   * Creates a matrix from a vector scaling
   * This is equivalent to (but much faster than):
   *
   *     mat3.identity(dest);
   *     mat3.scale(dest, dest, vec);
   *
   * @param {mat3} out mat3 receiving operation result
   * @param {vec2} v Scaling vector
   * @returns {mat3} out
   */
  
  function fromScaling(out, v) {
    out[0] = v[0];
    out[1] = 0;
    out[2] = 0;
    out[3] = 0;
    out[4] = v[1];
    out[5] = 0;
    out[6] = 0;
    out[7] = 0;
    out[8] = 1;
    return out;
  }
  /**
   * Copies the values from a mat2d into a mat3
   *
   * @param {mat3} out the receiving matrix
   * @param {mat2d} a the matrix to copy
   * @returns {mat3} out
   **/
  
  function fromMat2d(out, a) {
    out[0] = a[0];
    out[1] = a[1];
    out[2] = 0;
    out[3] = a[2];
    out[4] = a[3];
    out[5] = 0;
    out[6] = a[4];
    out[7] = a[5];
    out[8] = 1;
    return out;
  }
  /**
  * Calculates a 3x3 matrix from the given quaternion
  *
  * @param {mat3} out mat3 receiving operation result
  * @param {quat} q Quaternion to create matrix from
  *
  * @returns {mat3} out
  */
  
  function fromQuat(out, q) {
    var x = q[0],
        y = q[1],
        z = q[2],
        w = q[3];
    var x2 = x + x;
    var y2 = y + y;
    var z2 = z + z;
    var xx = x * x2;
    var yx = y * x2;
    var yy = y * y2;
    var zx = z * x2;
    var zy = z * y2;
    var zz = z * z2;
    var wx = w * x2;
    var wy = w * y2;
    var wz = w * z2;
    out[0] = 1 - yy - zz;
    out[3] = yx - wz;
    out[6] = zx + wy;
    out[1] = yx + wz;
    out[4] = 1 - xx - zz;
    out[7] = zy - wx;
    out[2] = zx - wy;
    out[5] = zy + wx;
    out[8] = 1 - xx - yy;
    return out;
  }
  /**
  * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix
  *
  * @param {mat3} out mat3 receiving operation result
  * @param {mat4} a Mat4 to derive the normal matrix from
  *
  * @returns {mat3} out
  */
  
  function normalFromMat4(out, a) {
    var a00 = a[0],
        a01 = a[1],
        a02 = a[2],
        a03 = a[3];
    var a10 = a[4],
        a11 = a[5],
        a12 = a[6],
        a13 = a[7];
    var a20 = a[8],
        a21 = a[9],
        a22 = a[10],
        a23 = a[11];
    var a30 = a[12],
        a31 = a[13],
        a32 = a[14],
        a33 = a[15];
    var b00 = a00 * a11 - a01 * a10;
    var b01 = a00 * a12 - a02 * a10;
    var b02 = a00 * a13 - a03 * a10;
    var b03 = a01 * a12 - a02 * a11;
    var b04 = a01 * a13 - a03 * a11;
    var b05 = a02 * a13 - a03 * a12;
    var b06 = a20 * a31 - a21 * a30;
    var b07 = a20 * a32 - a22 * a30;
    var b08 = a20 * a33 - a23 * a30;
    var b09 = a21 * a32 - a22 * a31;
    var b10 = a21 * a33 - a23 * a31;
    var b11 = a22 * a33 - a23 * a32; // Calculate the determinant
  
    var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;
  
    if (!det) {
      return null;
    }
  
    det = 1.0 / det;
    out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;
    out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;
    out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;
    out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;
    out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;
    out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;
    out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;
    out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;
    out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;
    return out;
  }
  /**
   * Generates a 2D projection matrix with the given bounds
   *
   * @param {mat3} out mat3 frustum matrix will be written into
   * @param {number} width Width of your gl context
   * @param {number} height Height of gl context
   * @returns {mat3} out
   */
  
  function projection(out, width, height) {
    out[0] = 2 / width;
    out[1] = 0;
    out[2] = 0;
    out[3] = 0;
    out[4] = -2 / height;
    out[5] = 0;
    out[6] = -1;
    out[7] = 1;
    out[8] = 1;
    return out;
  }
  /**
   * Returns a string representation of a mat3
   *
   * @param {mat3} a matrix to represent as a string
   * @returns {String} string representation of the matrix
   */
  
  function str(a) {
    return 'mat3(' + a[0] + ', ' + a[1] + ', ' + a[2] + ', ' + a[3] + ', ' + a[4] + ', ' + a[5] + ', ' + a[6] + ', ' + a[7] + ', ' + a[8] + ')';
  }
  /**
   * Returns Frobenius norm of a mat3
   *
   * @param {mat3} a the matrix to calculate Frobenius norm of
   * @returns {Number} Frobenius norm
   */
  
  function frob(a) {
    return Math.hypot(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8]);
  }
  /**
   * Adds two mat3's
   *
   * @param {mat3} out the receiving matrix
   * @param {mat3} a the first operand
   * @param {mat3} b the second operand
   * @returns {mat3} out
   */
  
  function add(out, a, b) {
    out[0] = a[0] + b[0];
    out[1] = a[1] + b[1];
    out[2] = a[2] + b[2];
    out[3] = a[3] + b[3];
    out[4] = a[4] + b[4];
    out[5] = a[5] + b[5];
    out[6] = a[6] + b[6];
    out[7] = a[7] + b[7];
    out[8] = a[8] + b[8];
    return out;
  }
  /**
   * Subtracts matrix b from matrix a
   *
   * @param {mat3} out the receiving matrix
   * @param {mat3} a the first operand
   * @param {mat3} b the second operand
   * @returns {mat3} out
   */
  
  function subtract(out, a, b) {
    out[0] = a[0] - b[0];
    out[1] = a[1] - b[1];
    out[2] = a[2] - b[2];
    out[3] = a[3] - b[3];
    out[4] = a[4] - b[4];
    out[5] = a[5] - b[5];
    out[6] = a[6] - b[6];
    out[7] = a[7] - b[7];
    out[8] = a[8] - b[8];
    return out;
  }
  /**
   * Multiply each element of the matrix by a scalar.
   *
   * @param {mat3} out the receiving matrix
   * @param {mat3} a the matrix to scale
   * @param {Number} b amount to scale the matrix's elements by
   * @returns {mat3} out
   */
  
  function multiplyScalar(out, a, b) {
    out[0] = a[0] * b;
    out[1] = a[1] * b;
    out[2] = a[2] * b;
    out[3] = a[3] * b;
    out[4] = a[4] * b;
    out[5] = a[5] * b;
    out[6] = a[6] * b;
    out[7] = a[7] * b;
    out[8] = a[8] * b;
    return out;
  }
  /**
   * Adds two mat3's after multiplying each element of the second operand by a scalar value.
   *
   * @param {mat3} out the receiving vector
   * @param {mat3} a the first operand
   * @param {mat3} b the second operand
   * @param {Number} scale the amount to scale b's elements by before adding
   * @returns {mat3} out
   */
  
  function multiplyScalarAndAdd(out, a, b, scale) {
    out[0] = a[0] + b[0] * scale;
    out[1] = a[1] + b[1] * scale;
    out[2] = a[2] + b[2] * scale;
    out[3] = a[3] + b[3] * scale;
    out[4] = a[4] + b[4] * scale;
    out[5] = a[5] + b[5] * scale;
    out[6] = a[6] + b[6] * scale;
    out[7] = a[7] + b[7] * scale;
    out[8] = a[8] + b[8] * scale;
    return out;
  }
  /**
   * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)
   *
   * @param {mat3} a The first matrix.
   * @param {mat3} b The second matrix.
   * @returns {Boolean} True if the matrices are equal, false otherwise.
   */
  
  function exactEquals(a, b) {
    return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7] && a[8] === b[8];
  }
  /**
   * Returns whether or not the matrices have approximately the same elements in the same position.
   *
   * @param {mat3} a The first matrix.
   * @param {mat3} b The second matrix.
   * @returns {Boolean} True if the matrices are equal, false otherwise.
   */
  
  function equals(a, b) {
    var a0 = a[0],
        a1 = a[1],
        a2 = a[2],
        a3 = a[3],
        a4 = a[4],
        a5 = a[5],
        a6 = a[6],
        a7 = a[7],
        a8 = a[8];
    var b0 = b[0],
        b1 = b[1],
        b2 = b[2],
        b3 = b[3],
        b4 = b[4],
        b5 = b[5],
        b6 = b[6],
        b7 = b[7],
        b8 = b[8];
    return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a8), Math.abs(b8));
  }
  /**
   * Alias for {@link mat3.multiply}
   * @function
   */
  
  var mul = multiply;
  /**
   * Alias for {@link mat3.subtract}
   * @function
   */
  
  var sub = subtract;
  
  /***/ }),
  
  /***/ "../../node_modules/gl-matrix/esm/mat4.js":
  /*!************************************************************************!*\
    !*** /Users/xintong/dev/loaders.gl/node_modules/gl-matrix/esm/mat4.js ***!
    \************************************************************************/
  /*! exports provided: create, clone, copy, fromValues, set, identity, transpose, invert, adjoint, determinant, multiply, translate, scale, rotate, rotateX, rotateY, rotateZ, fromTranslation, fromScaling, fromRotation, fromXRotation, fromYRotation, fromZRotation, fromRotationTranslation, fromQuat2, getTranslation, getScaling, getRotation, fromRotationTranslationScale, fromRotationTranslationScaleOrigin, fromQuat, frustum, perspective, perspectiveFromFieldOfView, ortho, lookAt, targetTo, str, frob, add, subtract, multiplyScalar, multiplyScalarAndAdd, exactEquals, equals, mul, sub */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "create", function() { return create; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "clone", function() { return clone; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "copy", function() { return copy; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromValues", function() { return fromValues; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "set", function() { return set; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "identity", function() { return identity; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "transpose", function() { return transpose; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "invert", function() { return invert; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "adjoint", function() { return adjoint; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "determinant", function() { return determinant; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "multiply", function() { return multiply; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "translate", function() { return translate; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scale", function() { return scale; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rotate", function() { return rotate; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rotateX", function() { return rotateX; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rotateY", function() { return rotateY; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rotateZ", function() { return rotateZ; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromTranslation", function() { return fromTranslation; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromScaling", function() { return fromScaling; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromRotation", function() { return fromRotation; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromXRotation", function() { return fromXRotation; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromYRotation", function() { return fromYRotation; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromZRotation", function() { return fromZRotation; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromRotationTranslation", function() { return fromRotationTranslation; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromQuat2", function() { return fromQuat2; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTranslation", function() { return getTranslation; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getScaling", function() { return getScaling; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getRotation", function() { return getRotation; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromRotationTranslationScale", function() { return fromRotationTranslationScale; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromRotationTranslationScaleOrigin", function() { return fromRotationTranslationScaleOrigin; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromQuat", function() { return fromQuat; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "frustum", function() { return frustum; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "perspective", function() { return perspective; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "perspectiveFromFieldOfView", function() { return perspectiveFromFieldOfView; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ortho", function() { return ortho; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lookAt", function() { return lookAt; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "targetTo", function() { return targetTo; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "str", function() { return str; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "frob", function() { return frob; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "add", function() { return add; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "subtract", function() { return subtract; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "multiplyScalar", function() { return multiplyScalar; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "multiplyScalarAndAdd", function() { return multiplyScalarAndAdd; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "exactEquals", function() { return exactEquals; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "equals", function() { return equals; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mul", function() { return mul; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sub", function() { return sub; });
  /* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common.js */ "../../node_modules/gl-matrix/esm/common.js");
  
  /**
   * 4x4 Matrix<br>Format: column-major, when typed out it looks like row-major<br>The matrices are being post multiplied.
   * @module mat4
   */
  
  /**
   * Creates a new identity mat4
   *
   * @returns {mat4} a new 4x4 matrix
   */
  
  function create() {
    var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"](16);
  
    if (_common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"] != Float32Array) {
      out[1] = 0;
      out[2] = 0;
      out[3] = 0;
      out[4] = 0;
      out[6] = 0;
      out[7] = 0;
      out[8] = 0;
      out[9] = 0;
      out[11] = 0;
      out[12] = 0;
      out[13] = 0;
      out[14] = 0;
    }
  
    out[0] = 1;
    out[5] = 1;
    out[10] = 1;
    out[15] = 1;
    return out;
  }
  /**
   * Creates a new mat4 initialized with values from an existing matrix
   *
   * @param {mat4} a matrix to clone
   * @returns {mat4} a new 4x4 matrix
   */
  
  function clone(a) {
    var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"](16);
    out[0] = a[0];
    out[1] = a[1];
    out[2] = a[2];
    out[3] = a[3];
    out[4] = a[4];
    out[5] = a[5];
    out[6] = a[6];
    out[7] = a[7];
    out[8] = a[8];
    out[9] = a[9];
    out[10] = a[10];
    out[11] = a[11];
    out[12] = a[12];
    out[13] = a[13];
    out[14] = a[14];
    out[15] = a[15];
    return out;
  }
  /**
   * Copy the values from one mat4 to another
   *
   * @param {mat4} out the receiving matrix
   * @param {mat4} a the source matrix
   * @returns {mat4} out
   */
  
  function copy(out, a) {
    out[0] = a[0];
    out[1] = a[1];
    out[2] = a[2];
    out[3] = a[3];
    out[4] = a[4];
    out[5] = a[5];
    out[6] = a[6];
    out[7] = a[7];
    out[8] = a[8];
    out[9] = a[9];
    out[10] = a[10];
    out[11] = a[11];
    out[12] = a[12];
    out[13] = a[13];
    out[14] = a[14];
    out[15] = a[15];
    return out;
  }
  /**
   * Create a new mat4 with the given values
   *
   * @param {Number} m00 Component in column 0, row 0 position (index 0)
   * @param {Number} m01 Component in column 0, row 1 position (index 1)
   * @param {Number} m02 Component in column 0, row 2 position (index 2)
   * @param {Number} m03 Component in column 0, row 3 position (index 3)
   * @param {Number} m10 Component in column 1, row 0 position (index 4)
   * @param {Number} m11 Component in column 1, row 1 position (index 5)
   * @param {Number} m12 Component in column 1, row 2 position (index 6)
   * @param {Number} m13 Component in column 1, row 3 position (index 7)
   * @param {Number} m20 Component in column 2, row 0 position (index 8)
   * @param {Number} m21 Component in column 2, row 1 position (index 9)
   * @param {Number} m22 Component in column 2, row 2 position (index 10)
   * @param {Number} m23 Component in column 2, row 3 position (index 11)
   * @param {Number} m30 Component in column 3, row 0 position (index 12)
   * @param {Number} m31 Component in column 3, row 1 position (index 13)
   * @param {Number} m32 Component in column 3, row 2 position (index 14)
   * @param {Number} m33 Component in column 3, row 3 position (index 15)
   * @returns {mat4} A new mat4
   */
  
  function fromValues(m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) {
    var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"](16);
    out[0] = m00;
    out[1] = m01;
    out[2] = m02;
    out[3] = m03;
    out[4] = m10;
    out[5] = m11;
    out[6] = m12;
    out[7] = m13;
    out[8] = m20;
    out[9] = m21;
    out[10] = m22;
    out[11] = m23;
    out[12] = m30;
    out[13] = m31;
    out[14] = m32;
    out[15] = m33;
    return out;
  }
  /**
   * Set the components of a mat4 to the given values
   *
   * @param {mat4} out the receiving matrix
   * @param {Number} m00 Component in column 0, row 0 position (index 0)
   * @param {Number} m01 Component in column 0, row 1 position (index 1)
   * @param {Number} m02 Component in column 0, row 2 position (index 2)
   * @param {Number} m03 Component in column 0, row 3 position (index 3)
   * @param {Number} m10 Component in column 1, row 0 position (index 4)
   * @param {Number} m11 Component in column 1, row 1 position (index 5)
   * @param {Number} m12 Component in column 1, row 2 position (index 6)
   * @param {Number} m13 Component in column 1, row 3 position (index 7)
   * @param {Number} m20 Component in column 2, row 0 position (index 8)
   * @param {Number} m21 Component in column 2, row 1 position (index 9)
   * @param {Number} m22 Component in column 2, row 2 position (index 10)
   * @param {Number} m23 Component in column 2, row 3 position (index 11)
   * @param {Number} m30 Component in column 3, row 0 position (index 12)
   * @param {Number} m31 Component in column 3, row 1 position (index 13)
   * @param {Number} m32 Component in column 3, row 2 position (index 14)
   * @param {Number} m33 Component in column 3, row 3 position (index 15)
   * @returns {mat4} out
   */
  
  function set(out, m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) {
    out[0] = m00;
    out[1] = m01;
    out[2] = m02;
    out[3] = m03;
    out[4] = m10;
    out[5] = m11;
    out[6] = m12;
    out[7] = m13;
    out[8] = m20;
    out[9] = m21;
    out[10] = m22;
    out[11] = m23;
    out[12] = m30;
    out[13] = m31;
    out[14] = m32;
    out[15] = m33;
    return out;
  }
  /**
   * Set a mat4 to the identity matrix
   *
   * @param {mat4} out the receiving matrix
   * @returns {mat4} out
   */
  
  function identity(out) {
    out[0] = 1;
    out[1] = 0;
    out[2] = 0;
    out[3] = 0;
    out[4] = 0;
    out[5] = 1;
    out[6] = 0;
    out[7] = 0;
    out[8] = 0;
    out[9] = 0;
    out[10] = 1;
    out[11] = 0;
    out[12] = 0;
    out[13] = 0;
    out[14] = 0;
    out[15] = 1;
    return out;
  }
  /**
   * Transpose the values of a mat4
   *
   * @param {mat4} out the receiving matrix
   * @param {mat4} a the source matrix
   * @returns {mat4} out
   */
  
  function transpose(out, a) {
    // If we are transposing ourselves we can skip a few steps but have to cache some values
    if (out === a) {
      var a01 = a[1],
          a02 = a[2],
          a03 = a[3];
      var a12 = a[6],
          a13 = a[7];
      var a23 = a[11];
      out[1] = a[4];
      out[2] = a[8];
      out[3] = a[12];
      out[4] = a01;
      out[6] = a[9];
      out[7] = a[13];
      out[8] = a02;
      out[9] = a12;
      out[11] = a[14];
      out[12] = a03;
      out[13] = a13;
      out[14] = a23;
    } else {
      out[0] = a[0];
      out[1] = a[4];
      out[2] = a[8];
      out[3] = a[12];
      out[4] = a[1];
      out[5] = a[5];
      out[6] = a[9];
      out[7] = a[13];
      out[8] = a[2];
      out[9] = a[6];
      out[10] = a[10];
      out[11] = a[14];
      out[12] = a[3];
      out[13] = a[7];
      out[14] = a[11];
      out[15] = a[15];
    }
  
    return out;
  }
  /**
   * Inverts a mat4
   *
   * @param {mat4} out the receiving matrix
   * @param {mat4} a the source matrix
   * @returns {mat4} out
   */
  
  function invert(out, a) {
    var a00 = a[0],
        a01 = a[1],
        a02 = a[2],
        a03 = a[3];
    var a10 = a[4],
        a11 = a[5],
        a12 = a[6],
        a13 = a[7];
    var a20 = a[8],
        a21 = a[9],
        a22 = a[10],
        a23 = a[11];
    var a30 = a[12],
        a31 = a[13],
        a32 = a[14],
        a33 = a[15];
    var b00 = a00 * a11 - a01 * a10;
    var b01 = a00 * a12 - a02 * a10;
    var b02 = a00 * a13 - a03 * a10;
    var b03 = a01 * a12 - a02 * a11;
    var b04 = a01 * a13 - a03 * a11;
    var b05 = a02 * a13 - a03 * a12;
    var b06 = a20 * a31 - a21 * a30;
    var b07 = a20 * a32 - a22 * a30;
    var b08 = a20 * a33 - a23 * a30;
    var b09 = a21 * a32 - a22 * a31;
    var b10 = a21 * a33 - a23 * a31;
    var b11 = a22 * a33 - a23 * a32; // Calculate the determinant
  
    var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;
  
    if (!det) {
      return null;
    }
  
    det = 1.0 / det;
    out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;
    out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;
    out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;
    out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;
    out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;
    out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;
    out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;
    out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;
    out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;
    out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;
    out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;
    out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;
    out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;
    out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;
    out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;
    out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;
    return out;
  }
  /**
   * Calculates the adjugate of a mat4
   *
   * @param {mat4} out the receiving matrix
   * @param {mat4} a the source matrix
   * @returns {mat4} out
   */
  
  function adjoint(out, a) {
    var a00 = a[0],
        a01 = a[1],
        a02 = a[2],
        a03 = a[3];
    var a10 = a[4],
        a11 = a[5],
        a12 = a[6],
        a13 = a[7];
    var a20 = a[8],
        a21 = a[9],
        a22 = a[10],
        a23 = a[11];
    var a30 = a[12],
        a31 = a[13],
        a32 = a[14],
        a33 = a[15];
    out[0] = a11 * (a22 * a33 - a23 * a32) - a21 * (a12 * a33 - a13 * a32) + a31 * (a12 * a23 - a13 * a22);
    out[1] = -(a01 * (a22 * a33 - a23 * a32) - a21 * (a02 * a33 - a03 * a32) + a31 * (a02 * a23 - a03 * a22));
    out[2] = a01 * (a12 * a33 - a13 * a32) - a11 * (a02 * a33 - a03 * a32) + a31 * (a02 * a13 - a03 * a12);
    out[3] = -(a01 * (a12 * a23 - a13 * a22) - a11 * (a02 * a23 - a03 * a22) + a21 * (a02 * a13 - a03 * a12));
    out[4] = -(a10 * (a22 * a33 - a23 * a32) - a20 * (a12 * a33 - a13 * a32) + a30 * (a12 * a23 - a13 * a22));
    out[5] = a00 * (a22 * a33 - a23 * a32) - a20 * (a02 * a33 - a03 * a32) + a30 * (a02 * a23 - a03 * a22);
    out[6] = -(a00 * (a12 * a33 - a13 * a32) - a10 * (a02 * a33 - a03 * a32) + a30 * (a02 * a13 - a03 * a12));
    out[7] = a00 * (a12 * a23 - a13 * a22) - a10 * (a02 * a23 - a03 * a22) + a20 * (a02 * a13 - a03 * a12);
    out[8] = a10 * (a21 * a33 - a23 * a31) - a20 * (a11 * a33 - a13 * a31) + a30 * (a11 * a23 - a13 * a21);
    out[9] = -(a00 * (a21 * a33 - a23 * a31) - a20 * (a01 * a33 - a03 * a31) + a30 * (a01 * a23 - a03 * a21));
    out[10] = a00 * (a11 * a33 - a13 * a31) - a10 * (a01 * a33 - a03 * a31) + a30 * (a01 * a13 - a03 * a11);
    out[11] = -(a00 * (a11 * a23 - a13 * a21) - a10 * (a01 * a23 - a03 * a21) + a20 * (a01 * a13 - a03 * a11));
    out[12] = -(a10 * (a21 * a32 - a22 * a31) - a20 * (a11 * a32 - a12 * a31) + a30 * (a11 * a22 - a12 * a21));
    out[13] = a00 * (a21 * a32 - a22 * a31) - a20 * (a01 * a32 - a02 * a31) + a30 * (a01 * a22 - a02 * a21);
    out[14] = -(a00 * (a11 * a32 - a12 * a31) - a10 * (a01 * a32 - a02 * a31) + a30 * (a01 * a12 - a02 * a11));
    out[15] = a00 * (a11 * a22 - a12 * a21) - a10 * (a01 * a22 - a02 * a21) + a20 * (a01 * a12 - a02 * a11);
    return out;
  }
  /**
   * Calculates the determinant of a mat4
   *
   * @param {mat4} a the source matrix
   * @returns {Number} determinant of a
   */
  
  function determinant(a) {
    var a00 = a[0],
        a01 = a[1],
        a02 = a[2],
        a03 = a[3];
    var a10 = a[4],
        a11 = a[5],
        a12 = a[6],
        a13 = a[7];
    var a20 = a[8],
        a21 = a[9],
        a22 = a[10],
        a23 = a[11];
    var a30 = a[12],
        a31 = a[13],
        a32 = a[14],
        a33 = a[15];
    var b00 = a00 * a11 - a01 * a10;
    var b01 = a00 * a12 - a02 * a10;
    var b02 = a00 * a13 - a03 * a10;
    var b03 = a01 * a12 - a02 * a11;
    var b04 = a01 * a13 - a03 * a11;
    var b05 = a02 * a13 - a03 * a12;
    var b06 = a20 * a31 - a21 * a30;
    var b07 = a20 * a32 - a22 * a30;
    var b08 = a20 * a33 - a23 * a30;
    var b09 = a21 * a32 - a22 * a31;
    var b10 = a21 * a33 - a23 * a31;
    var b11 = a22 * a33 - a23 * a32; // Calculate the determinant
  
    return b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;
  }
  /**
   * Multiplies two mat4s
   *
   * @param {mat4} out the receiving matrix
   * @param {mat4} a the first operand
   * @param {mat4} b the second operand
   * @returns {mat4} out
   */
  
  function multiply(out, a, b) {
    var a00 = a[0],
        a01 = a[1],
        a02 = a[2],
        a03 = a[3];
    var a10 = a[4],
        a11 = a[5],
        a12 = a[6],
        a13 = a[7];
    var a20 = a[8],
        a21 = a[9],
        a22 = a[10],
        a23 = a[11];
    var a30 = a[12],
        a31 = a[13],
        a32 = a[14],
        a33 = a[15]; // Cache only the current line of the second matrix
  
    var b0 = b[0],
        b1 = b[1],
        b2 = b[2],
        b3 = b[3];
    out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;
    out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;
    out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;
    out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;
    b0 = b[4];
    b1 = b[5];
    b2 = b[6];
    b3 = b[7];
    out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;
    out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;
    out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;
    out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;
    b0 = b[8];
    b1 = b[9];
    b2 = b[10];
    b3 = b[11];
    out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;
    out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;
    out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;
    out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;
    b0 = b[12];
    b1 = b[13];
    b2 = b[14];
    b3 = b[15];
    out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;
    out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;
    out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;
    out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;
    return out;
  }
  /**
   * Translate a mat4 by the given vector
   *
   * @param {mat4} out the receiving matrix
   * @param {mat4} a the matrix to translate
   * @param {vec3} v vector to translate by
   * @returns {mat4} out
   */
  
  function translate(out, a, v) {
    var x = v[0],
        y = v[1],
        z = v[2];
    var a00, a01, a02, a03;
    var a10, a11, a12, a13;
    var a20, a21, a22, a23;
  
    if (a === out) {
      out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];
      out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];
      out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];
      out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];
    } else {
      a00 = a[0];
      a01 = a[1];
      a02 = a[2];
      a03 = a[3];
      a10 = a[4];
      a11 = a[5];
      a12 = a[6];
      a13 = a[7];
      a20 = a[8];
      a21 = a[9];
      a22 = a[10];
      a23 = a[11];
      out[0] = a00;
      out[1] = a01;
      out[2] = a02;
      out[3] = a03;
      out[4] = a10;
      out[5] = a11;
      out[6] = a12;
      out[7] = a13;
      out[8] = a20;
      out[9] = a21;
      out[10] = a22;
      out[11] = a23;
      out[12] = a00 * x + a10 * y + a20 * z + a[12];
      out[13] = a01 * x + a11 * y + a21 * z + a[13];
      out[14] = a02 * x + a12 * y + a22 * z + a[14];
      out[15] = a03 * x + a13 * y + a23 * z + a[15];
    }
  
    return out;
  }
  /**
   * Scales the mat4 by the dimensions in the given vec3 not using vectorization
   *
   * @param {mat4} out the receiving matrix
   * @param {mat4} a the matrix to scale
   * @param {vec3} v the vec3 to scale the matrix by
   * @returns {mat4} out
   **/
  
  function scale(out, a, v) {
    var x = v[0],
        y = v[1],
        z = v[2];
    out[0] = a[0] * x;
    out[1] = a[1] * x;
    out[2] = a[2] * x;
    out[3] = a[3] * x;
    out[4] = a[4] * y;
    out[5] = a[5] * y;
    out[6] = a[6] * y;
    out[7] = a[7] * y;
    out[8] = a[8] * z;
    out[9] = a[9] * z;
    out[10] = a[10] * z;
    out[11] = a[11] * z;
    out[12] = a[12];
    out[13] = a[13];
    out[14] = a[14];
    out[15] = a[15];
    return out;
  }
  /**
   * Rotates a mat4 by the given angle around the given axis
   *
   * @param {mat4} out the receiving matrix
   * @param {mat4} a the matrix to rotate
   * @param {Number} rad the angle to rotate the matrix by
   * @param {vec3} axis the axis to rotate around
   * @returns {mat4} out
   */
  
  function rotate(out, a, rad, axis) {
    var x = axis[0],
        y = axis[1],
        z = axis[2];
    var len = Math.hypot(x, y, z);
    var s, c, t;
    var a00, a01, a02, a03;
    var a10, a11, a12, a13;
    var a20, a21, a22, a23;
    var b00, b01, b02;
    var b10, b11, b12;
    var b20, b21, b22;
  
    if (len < _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"]) {
      return null;
    }
  
    len = 1 / len;
    x *= len;
    y *= len;
    z *= len;
    s = Math.sin(rad);
    c = Math.cos(rad);
    t = 1 - c;
    a00 = a[0];
    a01 = a[1];
    a02 = a[2];
    a03 = a[3];
    a10 = a[4];
    a11 = a[5];
    a12 = a[6];
    a13 = a[7];
    a20 = a[8];
    a21 = a[9];
    a22 = a[10];
    a23 = a[11]; // Construct the elements of the rotation matrix
  
    b00 = x * x * t + c;
    b01 = y * x * t + z * s;
    b02 = z * x * t - y * s;
    b10 = x * y * t - z * s;
    b11 = y * y * t + c;
    b12 = z * y * t + x * s;
    b20 = x * z * t + y * s;
    b21 = y * z * t - x * s;
    b22 = z * z * t + c; // Perform rotation-specific matrix multiplication
  
    out[0] = a00 * b00 + a10 * b01 + a20 * b02;
    out[1] = a01 * b00 + a11 * b01 + a21 * b02;
    out[2] = a02 * b00 + a12 * b01 + a22 * b02;
    out[3] = a03 * b00 + a13 * b01 + a23 * b02;
    out[4] = a00 * b10 + a10 * b11 + a20 * b12;
    out[5] = a01 * b10 + a11 * b11 + a21 * b12;
    out[6] = a02 * b10 + a12 * b11 + a22 * b12;
    out[7] = a03 * b10 + a13 * b11 + a23 * b12;
    out[8] = a00 * b20 + a10 * b21 + a20 * b22;
    out[9] = a01 * b20 + a11 * b21 + a21 * b22;
    out[10] = a02 * b20 + a12 * b21 + a22 * b22;
    out[11] = a03 * b20 + a13 * b21 + a23 * b22;
  
    if (a !== out) {
      // If the source and destination differ, copy the unchanged last row
      out[12] = a[12];
      out[13] = a[13];
      out[14] = a[14];
      out[15] = a[15];
    }
  
    return out;
  }
  /**
   * Rotates a matrix by the given angle around the X axis
   *
   * @param {mat4} out the receiving matrix
   * @param {mat4} a the matrix to rotate
   * @param {Number} rad the angle to rotate the matrix by
   * @returns {mat4} out
   */
  
  function rotateX(out, a, rad) {
    var s = Math.sin(rad);
    var c = Math.cos(rad);
    var a10 = a[4];
    var a11 = a[5];
    var a12 = a[6];
    var a13 = a[7];
    var a20 = a[8];
    var a21 = a[9];
    var a22 = a[10];
    var a23 = a[11];
  
    if (a !== out) {
      // If the source and destination differ, copy the unchanged rows
      out[0] = a[0];
      out[1] = a[1];
      out[2] = a[2];
      out[3] = a[3];
      out[12] = a[12];
      out[13] = a[13];
      out[14] = a[14];
      out[15] = a[15];
    } // Perform axis-specific matrix multiplication
  
  
    out[4] = a10 * c + a20 * s;
    out[5] = a11 * c + a21 * s;
    out[6] = a12 * c + a22 * s;
    out[7] = a13 * c + a23 * s;
    out[8] = a20 * c - a10 * s;
    out[9] = a21 * c - a11 * s;
    out[10] = a22 * c - a12 * s;
    out[11] = a23 * c - a13 * s;
    return out;
  }
  /**
   * Rotates a matrix by the given angle around the Y axis
   *
   * @param {mat4} out the receiving matrix
   * @param {mat4} a the matrix to rotate
   * @param {Number} rad the angle to rotate the matrix by
   * @returns {mat4} out
   */
  
  function rotateY(out, a, rad) {
    var s = Math.sin(rad);
    var c = Math.cos(rad);
    var a00 = a[0];
    var a01 = a[1];
    var a02 = a[2];
    var a03 = a[3];
    var a20 = a[8];
    var a21 = a[9];
    var a22 = a[10];
    var a23 = a[11];
  
    if (a !== out) {
      // If the source and destination differ, copy the unchanged rows
      out[4] = a[4];
      out[5] = a[5];
      out[6] = a[6];
      out[7] = a[7];
      out[12] = a[12];
      out[13] = a[13];
      out[14] = a[14];
      out[15] = a[15];
    } // Perform axis-specific matrix multiplication
  
  
    out[0] = a00 * c - a20 * s;
    out[1] = a01 * c - a21 * s;
    out[2] = a02 * c - a22 * s;
    out[3] = a03 * c - a23 * s;
    out[8] = a00 * s + a20 * c;
    out[9] = a01 * s + a21 * c;
    out[10] = a02 * s + a22 * c;
    out[11] = a03 * s + a23 * c;
    return out;
  }
  /**
   * Rotates a matrix by the given angle around the Z axis
   *
   * @param {mat4} out the receiving matrix
   * @param {mat4} a the matrix to rotate
   * @param {Number} rad the angle to rotate the matrix by
   * @returns {mat4} out
   */
  
  function rotateZ(out, a, rad) {
    var s = Math.sin(rad);
    var c = Math.cos(rad);
    var a00 = a[0];
    var a01 = a[1];
    var a02 = a[2];
    var a03 = a[3];
    var a10 = a[4];
    var a11 = a[5];
    var a12 = a[6];
    var a13 = a[7];
  
    if (a !== out) {
      // If the source and destination differ, copy the unchanged last row
      out[8] = a[8];
      out[9] = a[9];
      out[10] = a[10];
      out[11] = a[11];
      out[12] = a[12];
      out[13] = a[13];
      out[14] = a[14];
      out[15] = a[15];
    } // Perform axis-specific matrix multiplication
  
  
    out[0] = a00 * c + a10 * s;
    out[1] = a01 * c + a11 * s;
    out[2] = a02 * c + a12 * s;
    out[3] = a03 * c + a13 * s;
    out[4] = a10 * c - a00 * s;
    out[5] = a11 * c - a01 * s;
    out[6] = a12 * c - a02 * s;
    out[7] = a13 * c - a03 * s;
    return out;
  }
  /**
   * Creates a matrix from a vector translation
   * This is equivalent to (but much faster than):
   *
   *     mat4.identity(dest);
   *     mat4.translate(dest, dest, vec);
   *
   * @param {mat4} out mat4 receiving operation result
   * @param {vec3} v Translation vector
   * @returns {mat4} out
   */
  
  function fromTranslation(out, v) {
    out[0] = 1;
    out[1] = 0;
    out[2] = 0;
    out[3] = 0;
    out[4] = 0;
    out[5] = 1;
    out[6] = 0;
    out[7] = 0;
    out[8] = 0;
    out[9] = 0;
    out[10] = 1;
    out[11] = 0;
    out[12] = v[0];
    out[13] = v[1];
    out[14] = v[2];
    out[15] = 1;
    return out;
  }
  /**
   * Creates a matrix from a vector scaling
   * This is equivalent to (but much faster than):
   *
   *     mat4.identity(dest);
   *     mat4.scale(dest, dest, vec);
   *
   * @param {mat4} out mat4 receiving operation result
   * @param {vec3} v Scaling vector
   * @returns {mat4} out
   */
  
  function fromScaling(out, v) {
    out[0] = v[0];
    out[1] = 0;
    out[2] = 0;
    out[3] = 0;
    out[4] = 0;
    out[5] = v[1];
    out[6] = 0;
    out[7] = 0;
    out[8] = 0;
    out[9] = 0;
    out[10] = v[2];
    out[11] = 0;
    out[12] = 0;
    out[13] = 0;
    out[14] = 0;
    out[15] = 1;
    return out;
  }
  /**
   * Creates a matrix from a given angle around a given axis
   * This is equivalent to (but much faster than):
   *
   *     mat4.identity(dest);
   *     mat4.rotate(dest, dest, rad, axis);
   *
   * @param {mat4} out mat4 receiving operation result
   * @param {Number} rad the angle to rotate the matrix by
   * @param {vec3} axis the axis to rotate around
   * @returns {mat4} out
   */
  
  function fromRotation(out, rad, axis) {
    var x = axis[0],
        y = axis[1],
        z = axis[2];
    var len = Math.hypot(x, y, z);
    var s, c, t;
  
    if (len < _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"]) {
      return null;
    }
  
    len = 1 / len;
    x *= len;
    y *= len;
    z *= len;
    s = Math.sin(rad);
    c = Math.cos(rad);
    t = 1 - c; // Perform rotation-specific matrix multiplication
  
    out[0] = x * x * t + c;
    out[1] = y * x * t + z * s;
    out[2] = z * x * t - y * s;
    out[3] = 0;
    out[4] = x * y * t - z * s;
    out[5] = y * y * t + c;
    out[6] = z * y * t + x * s;
    out[7] = 0;
    out[8] = x * z * t + y * s;
    out[9] = y * z * t - x * s;
    out[10] = z * z * t + c;
    out[11] = 0;
    out[12] = 0;
    out[13] = 0;
    out[14] = 0;
    out[15] = 1;
    return out;
  }
  /**
   * Creates a matrix from the given angle around the X axis
   * This is equivalent to (but much faster than):
   *
   *     mat4.identity(dest);
   *     mat4.rotateX(dest, dest, rad);
   *
   * @param {mat4} out mat4 receiving operation result
   * @param {Number} rad the angle to rotate the matrix by
   * @returns {mat4} out
   */
  
  function fromXRotation(out, rad) {
    var s = Math.sin(rad);
    var c = Math.cos(rad); // Perform axis-specific matrix multiplication
  
    out[0] = 1;
    out[1] = 0;
    out[2] = 0;
    out[3] = 0;
    out[4] = 0;
    out[5] = c;
    out[6] = s;
    out[7] = 0;
    out[8] = 0;
    out[9] = -s;
    out[10] = c;
    out[11] = 0;
    out[12] = 0;
    out[13] = 0;
    out[14] = 0;
    out[15] = 1;
    return out;
  }
  /**
   * Creates a matrix from the given angle around the Y axis
   * This is equivalent to (but much faster than):
   *
   *     mat4.identity(dest);
   *     mat4.rotateY(dest, dest, rad);
   *
   * @param {mat4} out mat4 receiving operation result
   * @param {Number} rad the angle to rotate the matrix by
   * @returns {mat4} out
   */
  
  function fromYRotation(out, rad) {
    var s = Math.sin(rad);
    var c = Math.cos(rad); // Perform axis-specific matrix multiplication
  
    out[0] = c;
    out[1] = 0;
    out[2] = -s;
    out[3] = 0;
    out[4] = 0;
    out[5] = 1;
    out[6] = 0;
    out[7] = 0;
    out[8] = s;
    out[9] = 0;
    out[10] = c;
    out[11] = 0;
    out[12] = 0;
    out[13] = 0;
    out[14] = 0;
    out[15] = 1;
    return out;
  }
  /**
   * Creates a matrix from the given angle around the Z axis
   * This is equivalent to (but much faster than):
   *
   *     mat4.identity(dest);
   *     mat4.rotateZ(dest, dest, rad);
   *
   * @param {mat4} out mat4 receiving operation result
   * @param {Number} rad the angle to rotate the matrix by
   * @returns {mat4} out
   */
  
  function fromZRotation(out, rad) {
    var s = Math.sin(rad);
    var c = Math.cos(rad); // Perform axis-specific matrix multiplication
  
    out[0] = c;
    out[1] = s;
    out[2] = 0;
    out[3] = 0;
    out[4] = -s;
    out[5] = c;
    out[6] = 0;
    out[7] = 0;
    out[8] = 0;
    out[9] = 0;
    out[10] = 1;
    out[11] = 0;
    out[12] = 0;
    out[13] = 0;
    out[14] = 0;
    out[15] = 1;
    return out;
  }
  /**
   * Creates a matrix from a quaternion rotation and vector translation
   * This is equivalent to (but much faster than):
   *
   *     mat4.identity(dest);
   *     mat4.translate(dest, vec);
   *     let quatMat = mat4.create();
   *     quat4.toMat4(quat, quatMat);
   *     mat4.multiply(dest, quatMat);
   *
   * @param {mat4} out mat4 receiving operation result
   * @param {quat4} q Rotation quaternion
   * @param {vec3} v Translation vector
   * @returns {mat4} out
   */
  
  function fromRotationTranslation(out, q, v) {
    // Quaternion math
    var x = q[0],
        y = q[1],
        z = q[2],
        w = q[3];
    var x2 = x + x;
    var y2 = y + y;
    var z2 = z + z;
    var xx = x * x2;
    var xy = x * y2;
    var xz = x * z2;
    var yy = y * y2;
    var yz = y * z2;
    var zz = z * z2;
    var wx = w * x2;
    var wy = w * y2;
    var wz = w * z2;
    out[0] = 1 - (yy + zz);
    out[1] = xy + wz;
    out[2] = xz - wy;
    out[3] = 0;
    out[4] = xy - wz;
    out[5] = 1 - (xx + zz);
    out[6] = yz + wx;
    out[7] = 0;
    out[8] = xz + wy;
    out[9] = yz - wx;
    out[10] = 1 - (xx + yy);
    out[11] = 0;
    out[12] = v[0];
    out[13] = v[1];
    out[14] = v[2];
    out[15] = 1;
    return out;
  }
  /**
   * Creates a new mat4 from a dual quat.
   *
   * @param {mat4} out Matrix
   * @param {quat2} a Dual Quaternion
   * @returns {mat4} mat4 receiving operation result
   */
  
  function fromQuat2(out, a) {
    var translation = new _common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"](3);
    var bx = -a[0],
        by = -a[1],
        bz = -a[2],
        bw = a[3],
        ax = a[4],
        ay = a[5],
        az = a[6],
        aw = a[7];
    var magnitude = bx * bx + by * by + bz * bz + bw * bw; //Only scale if it makes sense
  
    if (magnitude > 0) {
      translation[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2 / magnitude;
      translation[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2 / magnitude;
      translation[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2 / magnitude;
    } else {
      translation[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;
      translation[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;
      translation[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;
    }
  
    fromRotationTranslation(out, a, translation);
    return out;
  }
  /**
   * Returns the translation vector component of a transformation
   *  matrix. If a matrix is built with fromRotationTranslation,
   *  the returned vector will be the same as the translation vector
   *  originally supplied.
   * @param  {vec3} out Vector to receive translation component
   * @param  {mat4} mat Matrix to be decomposed (input)
   * @return {vec3} out
   */
  
  function getTranslation(out, mat) {
    out[0] = mat[12];
    out[1] = mat[13];
    out[2] = mat[14];
    return out;
  }
  /**
   * Returns the scaling factor component of a transformation
   *  matrix. If a matrix is built with fromRotationTranslationScale
   *  with a normalized Quaternion paramter, the returned vector will be
   *  the same as the scaling vector
   *  originally supplied.
   * @param  {vec3} out Vector to receive scaling factor component
   * @param  {mat4} mat Matrix to be decomposed (input)
   * @return {vec3} out
   */
  
  function getScaling(out, mat) {
    var m11 = mat[0];
    var m12 = mat[1];
    var m13 = mat[2];
    var m21 = mat[4];
    var m22 = mat[5];
    var m23 = mat[6];
    var m31 = mat[8];
    var m32 = mat[9];
    var m33 = mat[10];
    out[0] = Math.hypot(m11, m12, m13);
    out[1] = Math.hypot(m21, m22, m23);
    out[2] = Math.hypot(m31, m32, m33);
    return out;
  }
  /**
   * Returns a quaternion representing the rotational component
   *  of a transformation matrix. If a matrix is built with
   *  fromRotationTranslation, the returned quaternion will be the
   *  same as the quaternion originally supplied.
   * @param {quat} out Quaternion to receive the rotation component
   * @param {mat4} mat Matrix to be decomposed (input)
   * @return {quat} out
   */
  
  function getRotation(out, mat) {
    var scaling = new _common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"](3);
    getScaling(scaling, mat);
    var is1 = 1 / scaling[0];
    var is2 = 1 / scaling[1];
    var is3 = 1 / scaling[2];
    var sm11 = mat[0] * is1;
    var sm12 = mat[1] * is2;
    var sm13 = mat[2] * is3;
    var sm21 = mat[4] * is1;
    var sm22 = mat[5] * is2;
    var sm23 = mat[6] * is3;
    var sm31 = mat[8] * is1;
    var sm32 = mat[9] * is2;
    var sm33 = mat[10] * is3;
    var trace = sm11 + sm22 + sm33;
    var S = 0;
  
    if (trace > 0) {
      S = Math.sqrt(trace + 1.0) * 2;
      out[3] = 0.25 * S;
      out[0] = (sm23 - sm32) / S;
      out[1] = (sm31 - sm13) / S;
      out[2] = (sm12 - sm21) / S;
    } else if (sm11 > sm22 && sm11 > sm33) {
      S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;
      out[3] = (sm23 - sm32) / S;
      out[0] = 0.25 * S;
      out[1] = (sm12 + sm21) / S;
      out[2] = (sm31 + sm13) / S;
    } else if (sm22 > sm33) {
      S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;
      out[3] = (sm31 - sm13) / S;
      out[0] = (sm12 + sm21) / S;
      out[1] = 0.25 * S;
      out[2] = (sm23 + sm32) / S;
    } else {
      S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;
      out[3] = (sm12 - sm21) / S;
      out[0] = (sm31 + sm13) / S;
      out[1] = (sm23 + sm32) / S;
      out[2] = 0.25 * S;
    }
  
    return out;
  }
  /**
   * Creates a matrix from a quaternion rotation, vector translation and vector scale
   * This is equivalent to (but much faster than):
   *
   *     mat4.identity(dest);
   *     mat4.translate(dest, vec);
   *     let quatMat = mat4.create();
   *     quat4.toMat4(quat, quatMat);
   *     mat4.multiply(dest, quatMat);
   *     mat4.scale(dest, scale)
   *
   * @param {mat4} out mat4 receiving operation result
   * @param {quat4} q Rotation quaternion
   * @param {vec3} v Translation vector
   * @param {vec3} s Scaling vector
   * @returns {mat4} out
   */
  
  function fromRotationTranslationScale(out, q, v, s) {
    // Quaternion math
    var x = q[0],
        y = q[1],
        z = q[2],
        w = q[3];
    var x2 = x + x;
    var y2 = y + y;
    var z2 = z + z;
    var xx = x * x2;
    var xy = x * y2;
    var xz = x * z2;
    var yy = y * y2;
    var yz = y * z2;
    var zz = z * z2;
    var wx = w * x2;
    var wy = w * y2;
    var wz = w * z2;
    var sx = s[0];
    var sy = s[1];
    var sz = s[2];
    out[0] = (1 - (yy + zz)) * sx;
    out[1] = (xy + wz) * sx;
    out[2] = (xz - wy) * sx;
    out[3] = 0;
    out[4] = (xy - wz) * sy;
    out[5] = (1 - (xx + zz)) * sy;
    out[6] = (yz + wx) * sy;
    out[7] = 0;
    out[8] = (xz + wy) * sz;
    out[9] = (yz - wx) * sz;
    out[10] = (1 - (xx + yy)) * sz;
    out[11] = 0;
    out[12] = v[0];
    out[13] = v[1];
    out[14] = v[2];
    out[15] = 1;
    return out;
  }
  /**
   * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin
   * This is equivalent to (but much faster than):
   *
   *     mat4.identity(dest);
   *     mat4.translate(dest, vec);
   *     mat4.translate(dest, origin);
   *     let quatMat = mat4.create();
   *     quat4.toMat4(quat, quatMat);
   *     mat4.multiply(dest, quatMat);
   *     mat4.scale(dest, scale)
   *     mat4.translate(dest, negativeOrigin);
   *
   * @param {mat4} out mat4 receiving operation result
   * @param {quat4} q Rotation quaternion
   * @param {vec3} v Translation vector
   * @param {vec3} s Scaling vector
   * @param {vec3} o The origin vector around which to scale and rotate
   * @returns {mat4} out
   */
  
  function fromRotationTranslationScaleOrigin(out, q, v, s, o) {
    // Quaternion math
    var x = q[0],
        y = q[1],
        z = q[2],
        w = q[3];
    var x2 = x + x;
    var y2 = y + y;
    var z2 = z + z;
    var xx = x * x2;
    var xy = x * y2;
    var xz = x * z2;
    var yy = y * y2;
    var yz = y * z2;
    var zz = z * z2;
    var wx = w * x2;
    var wy = w * y2;
    var wz = w * z2;
    var sx = s[0];
    var sy = s[1];
    var sz = s[2];
    var ox = o[0];
    var oy = o[1];
    var oz = o[2];
    var out0 = (1 - (yy + zz)) * sx;
    var out1 = (xy + wz) * sx;
    var out2 = (xz - wy) * sx;
    var out4 = (xy - wz) * sy;
    var out5 = (1 - (xx + zz)) * sy;
    var out6 = (yz + wx) * sy;
    var out8 = (xz + wy) * sz;
    var out9 = (yz - wx) * sz;
    var out10 = (1 - (xx + yy)) * sz;
    out[0] = out0;
    out[1] = out1;
    out[2] = out2;
    out[3] = 0;
    out[4] = out4;
    out[5] = out5;
    out[6] = out6;
    out[7] = 0;
    out[8] = out8;
    out[9] = out9;
    out[10] = out10;
    out[11] = 0;
    out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz);
    out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz);
    out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz);
    out[15] = 1;
    return out;
  }
  /**
   * Calculates a 4x4 matrix from the given quaternion
   *
   * @param {mat4} out mat4 receiving operation result
   * @param {quat} q Quaternion to create matrix from
   *
   * @returns {mat4} out
   */
  
  function fromQuat(out, q) {
    var x = q[0],
        y = q[1],
        z = q[2],
        w = q[3];
    var x2 = x + x;
    var y2 = y + y;
    var z2 = z + z;
    var xx = x * x2;
    var yx = y * x2;
    var yy = y * y2;
    var zx = z * x2;
    var zy = z * y2;
    var zz = z * z2;
    var wx = w * x2;
    var wy = w * y2;
    var wz = w * z2;
    out[0] = 1 - yy - zz;
    out[1] = yx + wz;
    out[2] = zx - wy;
    out[3] = 0;
    out[4] = yx - wz;
    out[5] = 1 - xx - zz;
    out[6] = zy + wx;
    out[7] = 0;
    out[8] = zx + wy;
    out[9] = zy - wx;
    out[10] = 1 - xx - yy;
    out[11] = 0;
    out[12] = 0;
    out[13] = 0;
    out[14] = 0;
    out[15] = 1;
    return out;
  }
  /**
   * Generates a frustum matrix with the given bounds
   *
   * @param {mat4} out mat4 frustum matrix will be written into
   * @param {Number} left Left bound of the frustum
   * @param {Number} right Right bound of the frustum
   * @param {Number} bottom Bottom bound of the frustum
   * @param {Number} top Top bound of the frustum
   * @param {Number} near Near bound of the frustum
   * @param {Number} far Far bound of the frustum
   * @returns {mat4} out
   */
  
  function frustum(out, left, right, bottom, top, near, far) {
    var rl = 1 / (right - left);
    var tb = 1 / (top - bottom);
    var nf = 1 / (near - far);
    out[0] = near * 2 * rl;
    out[1] = 0;
    out[2] = 0;
    out[3] = 0;
    out[4] = 0;
    out[5] = near * 2 * tb;
    out[6] = 0;
    out[7] = 0;
    out[8] = (right + left) * rl;
    out[9] = (top + bottom) * tb;
    out[10] = (far + near) * nf;
    out[11] = -1;
    out[12] = 0;
    out[13] = 0;
    out[14] = far * near * 2 * nf;
    out[15] = 0;
    return out;
  }
  /**
   * Generates a perspective projection matrix with the given bounds.
   * Passing null/undefined/no value for far will generate infinite projection matrix.
   *
   * @param {mat4} out mat4 frustum matrix will be written into
   * @param {number} fovy Vertical field of view in radians
   * @param {number} aspect Aspect ratio. typically viewport width/height
   * @param {number} near Near bound of the frustum
   * @param {number} far Far bound of the frustum, can be null or Infinity
   * @returns {mat4} out
   */
  
  function perspective(out, fovy, aspect, near, far) {
    var f = 1.0 / Math.tan(fovy / 2),
        nf;
    out[0] = f / aspect;
    out[1] = 0;
    out[2] = 0;
    out[3] = 0;
    out[4] = 0;
    out[5] = f;
    out[6] = 0;
    out[7] = 0;
    out[8] = 0;
    out[9] = 0;
    out[11] = -1;
    out[12] = 0;
    out[13] = 0;
    out[15] = 0;
  
    if (far != null && far !== Infinity) {
      nf = 1 / (near - far);
      out[10] = (far + near) * nf;
      out[14] = 2 * far * near * nf;
    } else {
      out[10] = -1;
      out[14] = -2 * near;
    }
  
    return out;
  }
  /**
   * Generates a perspective projection matrix with the given field of view.
   * This is primarily useful for generating projection matrices to be used
   * with the still experiemental WebVR API.
   *
   * @param {mat4} out mat4 frustum matrix will be written into
   * @param {Object} fov Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees
   * @param {number} near Near bound of the frustum
   * @param {number} far Far bound of the frustum
   * @returns {mat4} out
   */
  
  function perspectiveFromFieldOfView(out, fov, near, far) {
    var upTan = Math.tan(fov.upDegrees * Math.PI / 180.0);
    var downTan = Math.tan(fov.downDegrees * Math.PI / 180.0);
    var leftTan = Math.tan(fov.leftDegrees * Math.PI / 180.0);
    var rightTan = Math.tan(fov.rightDegrees * Math.PI / 180.0);
    var xScale = 2.0 / (leftTan + rightTan);
    var yScale = 2.0 / (upTan + downTan);
    out[0] = xScale;
    out[1] = 0.0;
    out[2] = 0.0;
    out[3] = 0.0;
    out[4] = 0.0;
    out[5] = yScale;
    out[6] = 0.0;
    out[7] = 0.0;
    out[8] = -((leftTan - rightTan) * xScale * 0.5);
    out[9] = (upTan - downTan) * yScale * 0.5;
    out[10] = far / (near - far);
    out[11] = -1.0;
    out[12] = 0.0;
    out[13] = 0.0;
    out[14] = far * near / (near - far);
    out[15] = 0.0;
    return out;
  }
  /**
   * Generates a orthogonal projection matrix with the given bounds
   *
   * @param {mat4} out mat4 frustum matrix will be written into
   * @param {number} left Left bound of the frustum
   * @param {number} right Right bound of the frustum
   * @param {number} bottom Bottom bound of the frustum
   * @param {number} top Top bound of the frustum
   * @param {number} near Near bound of the frustum
   * @param {number} far Far bound of the frustum
   * @returns {mat4} out
   */
  
  function ortho(out, left, right, bottom, top, near, far) {
    var lr = 1 / (left - right);
    var bt = 1 / (bottom - top);
    var nf = 1 / (near - far);
    out[0] = -2 * lr;
    out[1] = 0;
    out[2] = 0;
    out[3] = 0;
    out[4] = 0;
    out[5] = -2 * bt;
    out[6] = 0;
    out[7] = 0;
    out[8] = 0;
    out[9] = 0;
    out[10] = 2 * nf;
    out[11] = 0;
    out[12] = (left + right) * lr;
    out[13] = (top + bottom) * bt;
    out[14] = (far + near) * nf;
    out[15] = 1;
    return out;
  }
  /**
   * Generates a look-at matrix with the given eye position, focal point, and up axis.
   * If you want a matrix that actually makes an object look at another object, you should use targetTo instead.
   *
   * @param {mat4} out mat4 frustum matrix will be written into
   * @param {vec3} eye Position of the viewer
   * @param {vec3} center Point the viewer is looking at
   * @param {vec3} up vec3 pointing up
   * @returns {mat4} out
   */
  
  function lookAt(out, eye, center, up) {
    var x0, x1, x2, y0, y1, y2, z0, z1, z2, len;
    var eyex = eye[0];
    var eyey = eye[1];
    var eyez = eye[2];
    var upx = up[0];
    var upy = up[1];
    var upz = up[2];
    var centerx = center[0];
    var centery = center[1];
    var centerz = center[2];
  
    if (Math.abs(eyex - centerx) < _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] && Math.abs(eyey - centery) < _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] && Math.abs(eyez - centerz) < _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"]) {
      return identity(out);
    }
  
    z0 = eyex - centerx;
    z1 = eyey - centery;
    z2 = eyez - centerz;
    len = 1 / Math.hypot(z0, z1, z2);
    z0 *= len;
    z1 *= len;
    z2 *= len;
    x0 = upy * z2 - upz * z1;
    x1 = upz * z0 - upx * z2;
    x2 = upx * z1 - upy * z0;
    len = Math.hypot(x0, x1, x2);
  
    if (!len) {
      x0 = 0;
      x1 = 0;
      x2 = 0;
    } else {
      len = 1 / len;
      x0 *= len;
      x1 *= len;
      x2 *= len;
    }
  
    y0 = z1 * x2 - z2 * x1;
    y1 = z2 * x0 - z0 * x2;
    y2 = z0 * x1 - z1 * x0;
    len = Math.hypot(y0, y1, y2);
  
    if (!len) {
      y0 = 0;
      y1 = 0;
      y2 = 0;
    } else {
      len = 1 / len;
      y0 *= len;
      y1 *= len;
      y2 *= len;
    }
  
    out[0] = x0;
    out[1] = y0;
    out[2] = z0;
    out[3] = 0;
    out[4] = x1;
    out[5] = y1;
    out[6] = z1;
    out[7] = 0;
    out[8] = x2;
    out[9] = y2;
    out[10] = z2;
    out[11] = 0;
    out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);
    out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);
    out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);
    out[15] = 1;
    return out;
  }
  /**
   * Generates a matrix that makes something look at something else.
   *
   * @param {mat4} out mat4 frustum matrix will be written into
   * @param {vec3} eye Position of the viewer
   * @param {vec3} center Point the viewer is looking at
   * @param {vec3} up vec3 pointing up
   * @returns {mat4} out
   */
  
  function targetTo(out, eye, target, up) {
    var eyex = eye[0],
        eyey = eye[1],
        eyez = eye[2],
        upx = up[0],
        upy = up[1],
        upz = up[2];
    var z0 = eyex - target[0],
        z1 = eyey - target[1],
        z2 = eyez - target[2];
    var len = z0 * z0 + z1 * z1 + z2 * z2;
  
    if (len > 0) {
      len = 1 / Math.sqrt(len);
      z0 *= len;
      z1 *= len;
      z2 *= len;
    }
  
    var x0 = upy * z2 - upz * z1,
        x1 = upz * z0 - upx * z2,
        x2 = upx * z1 - upy * z0;
    len = x0 * x0 + x1 * x1 + x2 * x2;
  
    if (len > 0) {
      len = 1 / Math.sqrt(len);
      x0 *= len;
      x1 *= len;
      x2 *= len;
    }
  
    out[0] = x0;
    out[1] = x1;
    out[2] = x2;
    out[3] = 0;
    out[4] = z1 * x2 - z2 * x1;
    out[5] = z2 * x0 - z0 * x2;
    out[6] = z0 * x1 - z1 * x0;
    out[7] = 0;
    out[8] = z0;
    out[9] = z1;
    out[10] = z2;
    out[11] = 0;
    out[12] = eyex;
    out[13] = eyey;
    out[14] = eyez;
    out[15] = 1;
    return out;
  }
  ;
  /**
   * Returns a string representation of a mat4
   *
   * @param {mat4} a matrix to represent as a string
   * @returns {String} string representation of the matrix
   */
  
  function str(a) {
    return 'mat4(' + a[0] + ', ' + a[1] + ', ' + a[2] + ', ' + a[3] + ', ' + a[4] + ', ' + a[5] + ', ' + a[6] + ', ' + a[7] + ', ' + a[8] + ', ' + a[9] + ', ' + a[10] + ', ' + a[11] + ', ' + a[12] + ', ' + a[13] + ', ' + a[14] + ', ' + a[15] + ')';
  }
  /**
   * Returns Frobenius norm of a mat4
   *
   * @param {mat4} a the matrix to calculate Frobenius norm of
   * @returns {Number} Frobenius norm
   */
  
  function frob(a) {
    return Math.hypot(a[0], a[1], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15]);
  }
  /**
   * Adds two mat4's
   *
   * @param {mat4} out the receiving matrix
   * @param {mat4} a the first operand
   * @param {mat4} b the second operand
   * @returns {mat4} out
   */
  
  function add(out, a, b) {
    out[0] = a[0] + b[0];
    out[1] = a[1] + b[1];
    out[2] = a[2] + b[2];
    out[3] = a[3] + b[3];
    out[4] = a[4] + b[4];
    out[5] = a[5] + b[5];
    out[6] = a[6] + b[6];
    out[7] = a[7] + b[7];
    out[8] = a[8] + b[8];
    out[9] = a[9] + b[9];
    out[10] = a[10] + b[10];
    out[11] = a[11] + b[11];
    out[12] = a[12] + b[12];
    out[13] = a[13] + b[13];
    out[14] = a[14] + b[14];
    out[15] = a[15] + b[15];
    return out;
  }
  /**
   * Subtracts matrix b from matrix a
   *
   * @param {mat4} out the receiving matrix
   * @param {mat4} a the first operand
   * @param {mat4} b the second operand
   * @returns {mat4} out
   */
  
  function subtract(out, a, b) {
    out[0] = a[0] - b[0];
    out[1] = a[1] - b[1];
    out[2] = a[2] - b[2];
    out[3] = a[3] - b[3];
    out[4] = a[4] - b[4];
    out[5] = a[5] - b[5];
    out[6] = a[6] - b[6];
    out[7] = a[7] - b[7];
    out[8] = a[8] - b[8];
    out[9] = a[9] - b[9];
    out[10] = a[10] - b[10];
    out[11] = a[11] - b[11];
    out[12] = a[12] - b[12];
    out[13] = a[13] - b[13];
    out[14] = a[14] - b[14];
    out[15] = a[15] - b[15];
    return out;
  }
  /**
   * Multiply each element of the matrix by a scalar.
   *
   * @param {mat4} out the receiving matrix
   * @param {mat4} a the matrix to scale
   * @param {Number} b amount to scale the matrix's elements by
   * @returns {mat4} out
   */
  
  function multiplyScalar(out, a, b) {
    out[0] = a[0] * b;
    out[1] = a[1] * b;
    out[2] = a[2] * b;
    out[3] = a[3] * b;
    out[4] = a[4] * b;
    out[5] = a[5] * b;
    out[6] = a[6] * b;
    out[7] = a[7] * b;
    out[8] = a[8] * b;
    out[9] = a[9] * b;
    out[10] = a[10] * b;
    out[11] = a[11] * b;
    out[12] = a[12] * b;
    out[13] = a[13] * b;
    out[14] = a[14] * b;
    out[15] = a[15] * b;
    return out;
  }
  /**
   * Adds two mat4's after multiplying each element of the second operand by a scalar value.
   *
   * @param {mat4} out the receiving vector
   * @param {mat4} a the first operand
   * @param {mat4} b the second operand
   * @param {Number} scale the amount to scale b's elements by before adding
   * @returns {mat4} out
   */
  
  function multiplyScalarAndAdd(out, a, b, scale) {
    out[0] = a[0] + b[0] * scale;
    out[1] = a[1] + b[1] * scale;
    out[2] = a[2] + b[2] * scale;
    out[3] = a[3] + b[3] * scale;
    out[4] = a[4] + b[4] * scale;
    out[5] = a[5] + b[5] * scale;
    out[6] = a[6] + b[6] * scale;
    out[7] = a[7] + b[7] * scale;
    out[8] = a[8] + b[8] * scale;
    out[9] = a[9] + b[9] * scale;
    out[10] = a[10] + b[10] * scale;
    out[11] = a[11] + b[11] * scale;
    out[12] = a[12] + b[12] * scale;
    out[13] = a[13] + b[13] * scale;
    out[14] = a[14] + b[14] * scale;
    out[15] = a[15] + b[15] * scale;
    return out;
  }
  /**
   * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)
   *
   * @param {mat4} a The first matrix.
   * @param {mat4} b The second matrix.
   * @returns {Boolean} True if the matrices are equal, false otherwise.
   */
  
  function exactEquals(a, b) {
    return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7] && a[8] === b[8] && a[9] === b[9] && a[10] === b[10] && a[11] === b[11] && a[12] === b[12] && a[13] === b[13] && a[14] === b[14] && a[15] === b[15];
  }
  /**
   * Returns whether or not the matrices have approximately the same elements in the same position.
   *
   * @param {mat4} a The first matrix.
   * @param {mat4} b The second matrix.
   * @returns {Boolean} True if the matrices are equal, false otherwise.
   */
  
  function equals(a, b) {
    var a0 = a[0],
        a1 = a[1],
        a2 = a[2],
        a3 = a[3];
    var a4 = a[4],
        a5 = a[5],
        a6 = a[6],
        a7 = a[7];
    var a8 = a[8],
        a9 = a[9],
        a10 = a[10],
        a11 = a[11];
    var a12 = a[12],
        a13 = a[13],
        a14 = a[14],
        a15 = a[15];
    var b0 = b[0],
        b1 = b[1],
        b2 = b[2],
        b3 = b[3];
    var b4 = b[4],
        b5 = b[5],
        b6 = b[6],
        b7 = b[7];
    var b8 = b[8],
        b9 = b[9],
        b10 = b[10],
        b11 = b[11];
    var b12 = b[12],
        b13 = b[13],
        b14 = b[14],
        b15 = b[15];
    return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a8), Math.abs(b8)) && Math.abs(a9 - b9) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a9), Math.abs(b9)) && Math.abs(a10 - b10) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a10), Math.abs(b10)) && Math.abs(a11 - b11) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a11), Math.abs(b11)) && Math.abs(a12 - b12) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a12), Math.abs(b12)) && Math.abs(a13 - b13) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a13), Math.abs(b13)) && Math.abs(a14 - b14) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a14), Math.abs(b14)) && Math.abs(a15 - b15) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a15), Math.abs(b15));
  }
  /**
   * Alias for {@link mat4.multiply}
   * @function
   */
  
  var mul = multiply;
  /**
   * Alias for {@link mat4.subtract}
   * @function
   */
  
  var sub = subtract;
  
  /***/ }),
  
  /***/ "../../node_modules/gl-matrix/esm/quat.js":
  /*!************************************************************************!*\
    !*** /Users/xintong/dev/loaders.gl/node_modules/gl-matrix/esm/quat.js ***!
    \************************************************************************/
  /*! exports provided: create, identity, setAxisAngle, getAxisAngle, getAngle, multiply, rotateX, rotateY, rotateZ, calculateW, exp, ln, pow, slerp, random, invert, conjugate, fromMat3, fromEuler, str, clone, fromValues, copy, set, add, mul, scale, dot, lerp, length, len, squaredLength, sqrLen, normalize, exactEquals, equals, rotationTo, sqlerp, setAxes */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "create", function() { return create; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "identity", function() { return identity; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setAxisAngle", function() { return setAxisAngle; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getAxisAngle", function() { return getAxisAngle; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getAngle", function() { return getAngle; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "multiply", function() { return multiply; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rotateX", function() { return rotateX; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rotateY", function() { return rotateY; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rotateZ", function() { return rotateZ; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "calculateW", function() { return calculateW; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "exp", function() { return exp; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ln", function() { return ln; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pow", function() { return pow; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "slerp", function() { return slerp; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "random", function() { return random; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "invert", function() { return invert; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "conjugate", function() { return conjugate; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromMat3", function() { return fromMat3; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromEuler", function() { return fromEuler; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "str", function() { return str; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "clone", function() { return clone; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromValues", function() { return fromValues; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "copy", function() { return copy; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "set", function() { return set; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "add", function() { return add; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mul", function() { return mul; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scale", function() { return scale; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dot", function() { return dot; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lerp", function() { return lerp; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "length", function() { return length; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "len", function() { return len; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "squaredLength", function() { return squaredLength; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sqrLen", function() { return sqrLen; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalize", function() { return normalize; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "exactEquals", function() { return exactEquals; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "equals", function() { return equals; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rotationTo", function() { return rotationTo; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sqlerp", function() { return sqlerp; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setAxes", function() { return setAxes; });
  /* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common.js */ "../../node_modules/gl-matrix/esm/common.js");
  /* harmony import */ var _mat3_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./mat3.js */ "../../node_modules/gl-matrix/esm/mat3.js");
  /* harmony import */ var _vec3_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./vec3.js */ "../../node_modules/gl-matrix/esm/vec3.js");
  /* harmony import */ var _vec4_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./vec4.js */ "../../node_modules/gl-matrix/esm/vec4.js");
  
  
  
  
  /**
   * Quaternion
   * @module quat
   */
  
  /**
   * Creates a new identity quat
   *
   * @returns {quat} a new quaternion
   */
  
  function create() {
    var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"](4);
  
    if (_common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"] != Float32Array) {
      out[0] = 0;
      out[1] = 0;
      out[2] = 0;
    }
  
    out[3] = 1;
    return out;
  }
  /**
   * Set a quat to the identity quaternion
   *
   * @param {quat} out the receiving quaternion
   * @returns {quat} out
   */
  
  function identity(out) {
    out[0] = 0;
    out[1] = 0;
    out[2] = 0;
    out[3] = 1;
    return out;
  }
  /**
   * Sets a quat from the given angle and rotation axis,
   * then returns it.
   *
   * @param {quat} out the receiving quaternion
   * @param {vec3} axis the axis around which to rotate
   * @param {Number} rad the angle in radians
   * @returns {quat} out
   **/
  
  function setAxisAngle(out, axis, rad) {
    rad = rad * 0.5;
    var s = Math.sin(rad);
    out[0] = s * axis[0];
    out[1] = s * axis[1];
    out[2] = s * axis[2];
    out[3] = Math.cos(rad);
    return out;
  }
  /**
   * Gets the rotation axis and angle for a given
   *  quaternion. If a quaternion is created with
   *  setAxisAngle, this method will return the same
   *  values as providied in the original parameter list
   *  OR functionally equivalent values.
   * Example: The quaternion formed by axis [0, 0, 1] and
   *  angle -90 is the same as the quaternion formed by
   *  [0, 0, 1] and 270. This method favors the latter.
   * @param  {vec3} out_axis  Vector receiving the axis of rotation
   * @param  {quat} q     Quaternion to be decomposed
   * @return {Number}     Angle, in radians, of the rotation
   */
  
  function getAxisAngle(out_axis, q) {
    var rad = Math.acos(q[3]) * 2.0;
    var s = Math.sin(rad / 2.0);
  
    if (s > _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"]) {
      out_axis[0] = q[0] / s;
      out_axis[1] = q[1] / s;
      out_axis[2] = q[2] / s;
    } else {
      // If s is zero, return any axis (no rotation - axis does not matter)
      out_axis[0] = 1;
      out_axis[1] = 0;
      out_axis[2] = 0;
    }
  
    return rad;
  }
  /**
   * Gets the angular distance between two unit quaternions
   *
   * @param  {quat} a     Origin unit quaternion 
   * @param  {quat} b     Destination unit quaternion
   * @return {Number}     Angle, in radians, between the two quaternions
   */
  
  function getAngle(a, b) {
    var dotproduct = dot(a, b);
    return Math.acos(2 * dotproduct * dotproduct - 1);
  }
  /**
   * Multiplies two quat's
   *
   * @param {quat} out the receiving quaternion
   * @param {quat} a the first operand
   * @param {quat} b the second operand
   * @returns {quat} out
   */
  
  function multiply(out, a, b) {
    var ax = a[0],
        ay = a[1],
        az = a[2],
        aw = a[3];
    var bx = b[0],
        by = b[1],
        bz = b[2],
        bw = b[3];
    out[0] = ax * bw + aw * bx + ay * bz - az * by;
    out[1] = ay * bw + aw * by + az * bx - ax * bz;
    out[2] = az * bw + aw * bz + ax * by - ay * bx;
    out[3] = aw * bw - ax * bx - ay * by - az * bz;
    return out;
  }
  /**
   * Rotates a quaternion by the given angle about the X axis
   *
   * @param {quat} out quat receiving operation result
   * @param {quat} a quat to rotate
   * @param {number} rad angle (in radians) to rotate
   * @returns {quat} out
   */
  
  function rotateX(out, a, rad) {
    rad *= 0.5;
    var ax = a[0],
        ay = a[1],
        az = a[2],
        aw = a[3];
    var bx = Math.sin(rad),
        bw = Math.cos(rad);
    out[0] = ax * bw + aw * bx;
    out[1] = ay * bw + az * bx;
    out[2] = az * bw - ay * bx;
    out[3] = aw * bw - ax * bx;
    return out;
  }
  /**
   * Rotates a quaternion by the given angle about the Y axis
   *
   * @param {quat} out quat receiving operation result
   * @param {quat} a quat to rotate
   * @param {number} rad angle (in radians) to rotate
   * @returns {quat} out
   */
  
  function rotateY(out, a, rad) {
    rad *= 0.5;
    var ax = a[0],
        ay = a[1],
        az = a[2],
        aw = a[3];
    var by = Math.sin(rad),
        bw = Math.cos(rad);
    out[0] = ax * bw - az * by;
    out[1] = ay * bw + aw * by;
    out[2] = az * bw + ax * by;
    out[3] = aw * bw - ay * by;
    return out;
  }
  /**
   * Rotates a quaternion by the given angle about the Z axis
   *
   * @param {quat} out quat receiving operation result
   * @param {quat} a quat to rotate
   * @param {number} rad angle (in radians) to rotate
   * @returns {quat} out
   */
  
  function rotateZ(out, a, rad) {
    rad *= 0.5;
    var ax = a[0],
        ay = a[1],
        az = a[2],
        aw = a[3];
    var bz = Math.sin(rad),
        bw = Math.cos(rad);
    out[0] = ax * bw + ay * bz;
    out[1] = ay * bw - ax * bz;
    out[2] = az * bw + aw * bz;
    out[3] = aw * bw - az * bz;
    return out;
  }
  /**
   * Calculates the W component of a quat from the X, Y, and Z components.
   * Assumes that quaternion is 1 unit in length.
   * Any existing W component will be ignored.
   *
   * @param {quat} out the receiving quaternion
   * @param {quat} a quat to calculate W component of
   * @returns {quat} out
   */
  
  function calculateW(out, a) {
    var x = a[0],
        y = a[1],
        z = a[2];
    out[0] = x;
    out[1] = y;
    out[2] = z;
    out[3] = Math.sqrt(Math.abs(1.0 - x * x - y * y - z * z));
    return out;
  }
  /**
   * Calculate the exponential of a unit quaternion.
   *
   * @param {quat} out the receiving quaternion
   * @param {quat} a quat to calculate the exponential of
   * @returns {quat} out
   */
  
  function exp(out, a) {
    var x = a[0],
        y = a[1],
        z = a[2],
        w = a[3];
    var r = Math.sqrt(x * x + y * y + z * z);
    var et = Math.exp(w);
    var s = r > 0 ? et * Math.sin(r) / r : 0;
    out[0] = x * s;
    out[1] = y * s;
    out[2] = z * s;
    out[3] = et * Math.cos(r);
    return out;
  }
  /**
   * Calculate the natural logarithm of a unit quaternion.
   *
   * @param {quat} out the receiving quaternion
   * @param {quat} a quat to calculate the exponential of
   * @returns {quat} out
   */
  
  function ln(out, a) {
    var x = a[0],
        y = a[1],
        z = a[2],
        w = a[3];
    var r = Math.sqrt(x * x + y * y + z * z);
    var t = r > 0 ? Math.atan2(r, w) / r : 0;
    out[0] = x * t;
    out[1] = y * t;
    out[2] = z * t;
    out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w);
    return out;
  }
  /**
   * Calculate the scalar power of a unit quaternion.
   *
   * @param {quat} out the receiving quaternion
   * @param {quat} a quat to calculate the exponential of
   * @param {Number} b amount to scale the quaternion by
   * @returns {quat} out
   */
  
  function pow(out, a, b) {
    ln(out, a);
    scale(out, out, b);
    exp(out, out);
    return out;
  }
  /**
   * Performs a spherical linear interpolation between two quat
   *
   * @param {quat} out the receiving quaternion
   * @param {quat} a the first operand
   * @param {quat} b the second operand
   * @param {Number} t interpolation amount, in the range [0-1], between the two inputs
   * @returns {quat} out
   */
  
  function slerp(out, a, b, t) {
    // benchmarks:
    //    http://jsperf.com/quaternion-slerp-implementations
    var ax = a[0],
        ay = a[1],
        az = a[2],
        aw = a[3];
    var bx = b[0],
        by = b[1],
        bz = b[2],
        bw = b[3];
    var omega, cosom, sinom, scale0, scale1; // calc cosine
  
    cosom = ax * bx + ay * by + az * bz + aw * bw; // adjust signs (if necessary)
  
    if (cosom < 0.0) {
      cosom = -cosom;
      bx = -bx;
      by = -by;
      bz = -bz;
      bw = -bw;
    } // calculate coefficients
  
  
    if (1.0 - cosom > _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"]) {
      // standard case (slerp)
      omega = Math.acos(cosom);
      sinom = Math.sin(omega);
      scale0 = Math.sin((1.0 - t) * omega) / sinom;
      scale1 = Math.sin(t * omega) / sinom;
    } else {
      // "from" and "to" quaternions are very close
      //  ... so we can do a linear interpolation
      scale0 = 1.0 - t;
      scale1 = t;
    } // calculate final values
  
  
    out[0] = scale0 * ax + scale1 * bx;
    out[1] = scale0 * ay + scale1 * by;
    out[2] = scale0 * az + scale1 * bz;
    out[3] = scale0 * aw + scale1 * bw;
    return out;
  }
  /**
   * Generates a random unit quaternion
   * 
   * @param {quat} out the receiving quaternion
   * @returns {quat} out
   */
  
  function random(out) {
    // Implementation of http://planning.cs.uiuc.edu/node198.html
    // TODO: Calling random 3 times is probably not the fastest solution
    var u1 = _common_js__WEBPACK_IMPORTED_MODULE_0__["RANDOM"]();
    var u2 = _common_js__WEBPACK_IMPORTED_MODULE_0__["RANDOM"]();
    var u3 = _common_js__WEBPACK_IMPORTED_MODULE_0__["RANDOM"]();
    var sqrt1MinusU1 = Math.sqrt(1 - u1);
    var sqrtU1 = Math.sqrt(u1);
    out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2);
    out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2);
    out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3);
    out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3);
    return out;
  }
  /**
   * Calculates the inverse of a quat
   *
   * @param {quat} out the receiving quaternion
   * @param {quat} a quat to calculate inverse of
   * @returns {quat} out
   */
  
  function invert(out, a) {
    var a0 = a[0],
        a1 = a[1],
        a2 = a[2],
        a3 = a[3];
    var dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;
    var invDot = dot ? 1.0 / dot : 0; // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0
  
    out[0] = -a0 * invDot;
    out[1] = -a1 * invDot;
    out[2] = -a2 * invDot;
    out[3] = a3 * invDot;
    return out;
  }
  /**
   * Calculates the conjugate of a quat
   * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result.
   *
   * @param {quat} out the receiving quaternion
   * @param {quat} a quat to calculate conjugate of
   * @returns {quat} out
   */
  
  function conjugate(out, a) {
    out[0] = -a[0];
    out[1] = -a[1];
    out[2] = -a[2];
    out[3] = a[3];
    return out;
  }
  /**
   * Creates a quaternion from the given 3x3 rotation matrix.
   *
   * NOTE: The resultant quaternion is not normalized, so you should be sure
   * to renormalize the quaternion yourself where necessary.
   *
   * @param {quat} out the receiving quaternion
   * @param {mat3} m rotation matrix
   * @returns {quat} out
   * @function
   */
  
  function fromMat3(out, m) {
    // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes
    // article "Quaternion Calculus and Fast Animation".
    var fTrace = m[0] + m[4] + m[8];
    var fRoot;
  
    if (fTrace > 0.0) {
      // |w| > 1/2, may as well choose w > 1/2
      fRoot = Math.sqrt(fTrace + 1.0); // 2w
  
      out[3] = 0.5 * fRoot;
      fRoot = 0.5 / fRoot; // 1/(4w)
  
      out[0] = (m[5] - m[7]) * fRoot;
      out[1] = (m[6] - m[2]) * fRoot;
      out[2] = (m[1] - m[3]) * fRoot;
    } else {
      // |w| <= 1/2
      var i = 0;
      if (m[4] > m[0]) i = 1;
      if (m[8] > m[i * 3 + i]) i = 2;
      var j = (i + 1) % 3;
      var k = (i + 2) % 3;
      fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1.0);
      out[i] = 0.5 * fRoot;
      fRoot = 0.5 / fRoot;
      out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot;
      out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot;
      out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot;
    }
  
    return out;
  }
  /**
   * Creates a quaternion from the given euler angle x, y, z.
   *
   * @param {quat} out the receiving quaternion
   * @param {x} Angle to rotate around X axis in degrees.
   * @param {y} Angle to rotate around Y axis in degrees.
   * @param {z} Angle to rotate around Z axis in degrees.
   * @returns {quat} out
   * @function
   */
  
  function fromEuler(out, x, y, z) {
    var halfToRad = 0.5 * Math.PI / 180.0;
    x *= halfToRad;
    y *= halfToRad;
    z *= halfToRad;
    var sx = Math.sin(x);
    var cx = Math.cos(x);
    var sy = Math.sin(y);
    var cy = Math.cos(y);
    var sz = Math.sin(z);
    var cz = Math.cos(z);
    out[0] = sx * cy * cz - cx * sy * sz;
    out[1] = cx * sy * cz + sx * cy * sz;
    out[2] = cx * cy * sz - sx * sy * cz;
    out[3] = cx * cy * cz + sx * sy * sz;
    return out;
  }
  /**
   * Returns a string representation of a quatenion
   *
   * @param {quat} a vector to represent as a string
   * @returns {String} string representation of the vector
   */
  
  function str(a) {
    return 'quat(' + a[0] + ', ' + a[1] + ', ' + a[2] + ', ' + a[3] + ')';
  }
  /**
   * Creates a new quat initialized with values from an existing quaternion
   *
   * @param {quat} a quaternion to clone
   * @returns {quat} a new quaternion
   * @function
   */
  
  var clone = _vec4_js__WEBPACK_IMPORTED_MODULE_3__["clone"];
  /**
   * Creates a new quat initialized with the given values
   *
   * @param {Number} x X component
   * @param {Number} y Y component
   * @param {Number} z Z component
   * @param {Number} w W component
   * @returns {quat} a new quaternion
   * @function
   */
  
  var fromValues = _vec4_js__WEBPACK_IMPORTED_MODULE_3__["fromValues"];
  /**
   * Copy the values from one quat to another
   *
   * @param {quat} out the receiving quaternion
   * @param {quat} a the source quaternion
   * @returns {quat} out
   * @function
   */
  
  var copy = _vec4_js__WEBPACK_IMPORTED_MODULE_3__["copy"];
  /**
   * Set the components of a quat to the given values
   *
   * @param {quat} out the receiving quaternion
   * @param {Number} x X component
   * @param {Number} y Y component
   * @param {Number} z Z component
   * @param {Number} w W component
   * @returns {quat} out
   * @function
   */
  
  var set = _vec4_js__WEBPACK_IMPORTED_MODULE_3__["set"];
  /**
   * Adds two quat's
   *
   * @param {quat} out the receiving quaternion
   * @param {quat} a the first operand
   * @param {quat} b the second operand
   * @returns {quat} out
   * @function
   */
  
  var add = _vec4_js__WEBPACK_IMPORTED_MODULE_3__["add"];
  /**
   * Alias for {@link quat.multiply}
   * @function
   */
  
  var mul = multiply;
  /**
   * Scales a quat by a scalar number
   *
   * @param {quat} out the receiving vector
   * @param {quat} a the vector to scale
   * @param {Number} b amount to scale the vector by
   * @returns {quat} out
   * @function
   */
  
  var scale = _vec4_js__WEBPACK_IMPORTED_MODULE_3__["scale"];
  /**
   * Calculates the dot product of two quat's
   *
   * @param {quat} a the first operand
   * @param {quat} b the second operand
   * @returns {Number} dot product of a and b
   * @function
   */
  
  var dot = _vec4_js__WEBPACK_IMPORTED_MODULE_3__["dot"];
  /**
   * Performs a linear interpolation between two quat's
   *
   * @param {quat} out the receiving quaternion
   * @param {quat} a the first operand
   * @param {quat} b the second operand
   * @param {Number} t interpolation amount, in the range [0-1], between the two inputs
   * @returns {quat} out
   * @function
   */
  
  var lerp = _vec4_js__WEBPACK_IMPORTED_MODULE_3__["lerp"];
  /**
   * Calculates the length of a quat
   *
   * @param {quat} a vector to calculate length of
   * @returns {Number} length of a
   */
  
  var length = _vec4_js__WEBPACK_IMPORTED_MODULE_3__["length"];
  /**
   * Alias for {@link quat.length}
   * @function
   */
  
  var len = length;
  /**
   * Calculates the squared length of a quat
   *
   * @param {quat} a vector to calculate squared length of
   * @returns {Number} squared length of a
   * @function
   */
  
  var squaredLength = _vec4_js__WEBPACK_IMPORTED_MODULE_3__["squaredLength"];
  /**
   * Alias for {@link quat.squaredLength}
   * @function
   */
  
  var sqrLen = squaredLength;
  /**
   * Normalize a quat
   *
   * @param {quat} out the receiving quaternion
   * @param {quat} a quaternion to normalize
   * @returns {quat} out
   * @function
   */
  
  var normalize = _vec4_js__WEBPACK_IMPORTED_MODULE_3__["normalize"];
  /**
   * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===)
   *
   * @param {quat} a The first quaternion.
   * @param {quat} b The second quaternion.
   * @returns {Boolean} True if the vectors are equal, false otherwise.
   */
  
  var exactEquals = _vec4_js__WEBPACK_IMPORTED_MODULE_3__["exactEquals"];
  /**
   * Returns whether or not the quaternions have approximately the same elements in the same position.
   *
   * @param {quat} a The first vector.
   * @param {quat} b The second vector.
   * @returns {Boolean} True if the vectors are equal, false otherwise.
   */
  
  var equals = _vec4_js__WEBPACK_IMPORTED_MODULE_3__["equals"];
  /**
   * Sets a quaternion to represent the shortest rotation from one
   * vector to another.
   *
   * Both vectors are assumed to be unit length.
   *
   * @param {quat} out the receiving quaternion.
   * @param {vec3} a the initial vector
   * @param {vec3} b the destination vector
   * @returns {quat} out
   */
  
  var rotationTo = function () {
    var tmpvec3 = _vec3_js__WEBPACK_IMPORTED_MODULE_2__["create"]();
    var xUnitVec3 = _vec3_js__WEBPACK_IMPORTED_MODULE_2__["fromValues"](1, 0, 0);
    var yUnitVec3 = _vec3_js__WEBPACK_IMPORTED_MODULE_2__["fromValues"](0, 1, 0);
    return function (out, a, b) {
      var dot = _vec3_js__WEBPACK_IMPORTED_MODULE_2__["dot"](a, b);
  
      if (dot < -0.999999) {
        _vec3_js__WEBPACK_IMPORTED_MODULE_2__["cross"](tmpvec3, xUnitVec3, a);
        if (_vec3_js__WEBPACK_IMPORTED_MODULE_2__["len"](tmpvec3) < 0.000001) _vec3_js__WEBPACK_IMPORTED_MODULE_2__["cross"](tmpvec3, yUnitVec3, a);
        _vec3_js__WEBPACK_IMPORTED_MODULE_2__["normalize"](tmpvec3, tmpvec3);
        setAxisAngle(out, tmpvec3, Math.PI);
        return out;
      } else if (dot > 0.999999) {
        out[0] = 0;
        out[1] = 0;
        out[2] = 0;
        out[3] = 1;
        return out;
      } else {
        _vec3_js__WEBPACK_IMPORTED_MODULE_2__["cross"](tmpvec3, a, b);
        out[0] = tmpvec3[0];
        out[1] = tmpvec3[1];
        out[2] = tmpvec3[2];
        out[3] = 1 + dot;
        return normalize(out, out);
      }
    };
  }();
  /**
   * Performs a spherical linear interpolation with two control points
   *
   * @param {quat} out the receiving quaternion
   * @param {quat} a the first operand
   * @param {quat} b the second operand
   * @param {quat} c the third operand
   * @param {quat} d the fourth operand
   * @param {Number} t interpolation amount, in the range [0-1], between the two inputs
   * @returns {quat} out
   */
  
  var sqlerp = function () {
    var temp1 = create();
    var temp2 = create();
    return function (out, a, b, c, d, t) {
      slerp(temp1, a, d, t);
      slerp(temp2, b, c, t);
      slerp(out, temp1, temp2, 2 * t * (1 - t));
      return out;
    };
  }();
  /**
   * Sets the specified quaternion with values corresponding to the given
   * axes. Each axis is a vec3 and is expected to be unit length and
   * perpendicular to all other specified axes.
   *
   * @param {vec3} view  the vector representing the viewing direction
   * @param {vec3} right the vector representing the local "right" direction
   * @param {vec3} up    the vector representing the local "up" direction
   * @returns {quat} out
   */
  
  var setAxes = function () {
    var matr = _mat3_js__WEBPACK_IMPORTED_MODULE_1__["create"]();
    return function (out, view, right, up) {
      matr[0] = right[0];
      matr[3] = right[1];
      matr[6] = right[2];
      matr[1] = up[0];
      matr[4] = up[1];
      matr[7] = up[2];
      matr[2] = -view[0];
      matr[5] = -view[1];
      matr[8] = -view[2];
      return normalize(out, fromMat3(out, matr));
    };
  }();
  
  /***/ }),
  
  /***/ "../../node_modules/gl-matrix/esm/vec2.js":
  /*!************************************************************************!*\
    !*** /Users/xintong/dev/loaders.gl/node_modules/gl-matrix/esm/vec2.js ***!
    \************************************************************************/
  /*! exports provided: create, clone, fromValues, copy, set, add, subtract, multiply, divide, ceil, floor, min, max, round, scale, scaleAndAdd, distance, squaredDistance, length, squaredLength, negate, inverse, normalize, dot, cross, lerp, random, transformMat2, transformMat2d, transformMat3, transformMat4, rotate, angle, zero, str, exactEquals, equals, len, sub, mul, div, dist, sqrDist, sqrLen, forEach */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "create", function() { return create; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "clone", function() { return clone; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromValues", function() { return fromValues; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "copy", function() { return copy; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "set", function() { return set; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "add", function() { return add; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "subtract", function() { return subtract; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "multiply", function() { return multiply; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "divide", function() { return divide; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ceil", function() { return ceil; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "floor", function() { return floor; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "min", function() { return min; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "max", function() { return max; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "round", function() { return round; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scale", function() { return scale; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scaleAndAdd", function() { return scaleAndAdd; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "distance", function() { return distance; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "squaredDistance", function() { return squaredDistance; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "length", function() { return length; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "squaredLength", function() { return squaredLength; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "negate", function() { return negate; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "inverse", function() { return inverse; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalize", function() { return normalize; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dot", function() { return dot; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cross", function() { return cross; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lerp", function() { return lerp; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "random", function() { return random; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "transformMat2", function() { return transformMat2; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "transformMat2d", function() { return transformMat2d; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "transformMat3", function() { return transformMat3; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "transformMat4", function() { return transformMat4; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rotate", function() { return rotate; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "angle", function() { return angle; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "zero", function() { return zero; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "str", function() { return str; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "exactEquals", function() { return exactEquals; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "equals", function() { return equals; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "len", function() { return len; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sub", function() { return sub; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mul", function() { return mul; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "div", function() { return div; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dist", function() { return dist; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sqrDist", function() { return sqrDist; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sqrLen", function() { return sqrLen; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "forEach", function() { return forEach; });
  /* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common.js */ "../../node_modules/gl-matrix/esm/common.js");
  
  /**
   * 2 Dimensional Vector
   * @module vec2
   */
  
  /**
   * Creates a new, empty vec2
   *
   * @returns {vec2} a new 2D vector
   */
  
  function create() {
    var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"](2);
  
    if (_common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"] != Float32Array) {
      out[0] = 0;
      out[1] = 0;
    }
  
    return out;
  }
  /**
   * Creates a new vec2 initialized with values from an existing vector
   *
   * @param {vec2} a vector to clone
   * @returns {vec2} a new 2D vector
   */
  
  function clone(a) {
    var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"](2);
    out[0] = a[0];
    out[1] = a[1];
    return out;
  }
  /**
   * Creates a new vec2 initialized with the given values
   *
   * @param {Number} x X component
   * @param {Number} y Y component
   * @returns {vec2} a new 2D vector
   */
  
  function fromValues(x, y) {
    var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"](2);
    out[0] = x;
    out[1] = y;
    return out;
  }
  /**
   * Copy the values from one vec2 to another
   *
   * @param {vec2} out the receiving vector
   * @param {vec2} a the source vector
   * @returns {vec2} out
   */
  
  function copy(out, a) {
    out[0] = a[0];
    out[1] = a[1];
    return out;
  }
  /**
   * Set the components of a vec2 to the given values
   *
   * @param {vec2} out the receiving vector
   * @param {Number} x X component
   * @param {Number} y Y component
   * @returns {vec2} out
   */
  
  function set(out, x, y) {
    out[0] = x;
    out[1] = y;
    return out;
  }
  /**
   * Adds two vec2's
   *
   * @param {vec2} out the receiving vector
   * @param {vec2} a the first operand
   * @param {vec2} b the second operand
   * @returns {vec2} out
   */
  
  function add(out, a, b) {
    out[0] = a[0] + b[0];
    out[1] = a[1] + b[1];
    return out;
  }
  /**
   * Subtracts vector b from vector a
   *
   * @param {vec2} out the receiving vector
   * @param {vec2} a the first operand
   * @param {vec2} b the second operand
   * @returns {vec2} out
   */
  
  function subtract(out, a, b) {
    out[0] = a[0] - b[0];
    out[1] = a[1] - b[1];
    return out;
  }
  /**
   * Multiplies two vec2's
   *
   * @param {vec2} out the receiving vector
   * @param {vec2} a the first operand
   * @param {vec2} b the second operand
   * @returns {vec2} out
   */
  
  function multiply(out, a, b) {
    out[0] = a[0] * b[0];
    out[1] = a[1] * b[1];
    return out;
  }
  /**
   * Divides two vec2's
   *
   * @param {vec2} out the receiving vector
   * @param {vec2} a the first operand
   * @param {vec2} b the second operand
   * @returns {vec2} out
   */
  
  function divide(out, a, b) {
    out[0] = a[0] / b[0];
    out[1] = a[1] / b[1];
    return out;
  }
  /**
   * Math.ceil the components of a vec2
   *
   * @param {vec2} out the receiving vector
   * @param {vec2} a vector to ceil
   * @returns {vec2} out
   */
  
  function ceil(out, a) {
    out[0] = Math.ceil(a[0]);
    out[1] = Math.ceil(a[1]);
    return out;
  }
  /**
   * Math.floor the components of a vec2
   *
   * @param {vec2} out the receiving vector
   * @param {vec2} a vector to floor
   * @returns {vec2} out
   */
  
  function floor(out, a) {
    out[0] = Math.floor(a[0]);
    out[1] = Math.floor(a[1]);
    return out;
  }
  /**
   * Returns the minimum of two vec2's
   *
   * @param {vec2} out the receiving vector
   * @param {vec2} a the first operand
   * @param {vec2} b the second operand
   * @returns {vec2} out
   */
  
  function min(out, a, b) {
    out[0] = Math.min(a[0], b[0]);
    out[1] = Math.min(a[1], b[1]);
    return out;
  }
  /**
   * Returns the maximum of two vec2's
   *
   * @param {vec2} out the receiving vector
   * @param {vec2} a the first operand
   * @param {vec2} b the second operand
   * @returns {vec2} out
   */
  
  function max(out, a, b) {
    out[0] = Math.max(a[0], b[0]);
    out[1] = Math.max(a[1], b[1]);
    return out;
  }
  /**
   * Math.round the components of a vec2
   *
   * @param {vec2} out the receiving vector
   * @param {vec2} a vector to round
   * @returns {vec2} out
   */
  
  function round(out, a) {
    out[0] = Math.round(a[0]);
    out[1] = Math.round(a[1]);
    return out;
  }
  /**
   * Scales a vec2 by a scalar number
   *
   * @param {vec2} out the receiving vector
   * @param {vec2} a the vector to scale
   * @param {Number} b amount to scale the vector by
   * @returns {vec2} out
   */
  
  function scale(out, a, b) {
    out[0] = a[0] * b;
    out[1] = a[1] * b;
    return out;
  }
  /**
   * Adds two vec2's after scaling the second operand by a scalar value
   *
   * @param {vec2} out the receiving vector
   * @param {vec2} a the first operand
   * @param {vec2} b the second operand
   * @param {Number} scale the amount to scale b by before adding
   * @returns {vec2} out
   */
  
  function scaleAndAdd(out, a, b, scale) {
    out[0] = a[0] + b[0] * scale;
    out[1] = a[1] + b[1] * scale;
    return out;
  }
  /**
   * Calculates the euclidian distance between two vec2's
   *
   * @param {vec2} a the first operand
   * @param {vec2} b the second operand
   * @returns {Number} distance between a and b
   */
  
  function distance(a, b) {
    var x = b[0] - a[0],
        y = b[1] - a[1];
    return Math.hypot(x, y);
  }
  /**
   * Calculates the squared euclidian distance between two vec2's
   *
   * @param {vec2} a the first operand
   * @param {vec2} b the second operand
   * @returns {Number} squared distance between a and b
   */
  
  function squaredDistance(a, b) {
    var x = b[0] - a[0],
        y = b[1] - a[1];
    return x * x + y * y;
  }
  /**
   * Calculates the length of a vec2
   *
   * @param {vec2} a vector to calculate length of
   * @returns {Number} length of a
   */
  
  function length(a) {
    var x = a[0],
        y = a[1];
    return Math.hypot(x, y);
  }
  /**
   * Calculates the squared length of a vec2
   *
   * @param {vec2} a vector to calculate squared length of
   * @returns {Number} squared length of a
   */
  
  function squaredLength(a) {
    var x = a[0],
        y = a[1];
    return x * x + y * y;
  }
  /**
   * Negates the components of a vec2
   *
   * @param {vec2} out the receiving vector
   * @param {vec2} a vector to negate
   * @returns {vec2} out
   */
  
  function negate(out, a) {
    out[0] = -a[0];
    out[1] = -a[1];
    return out;
  }
  /**
   * Returns the inverse of the components of a vec2
   *
   * @param {vec2} out the receiving vector
   * @param {vec2} a vector to invert
   * @returns {vec2} out
   */
  
  function inverse(out, a) {
    out[0] = 1.0 / a[0];
    out[1] = 1.0 / a[1];
    return out;
  }
  /**
   * Normalize a vec2
   *
   * @param {vec2} out the receiving vector
   * @param {vec2} a vector to normalize
   * @returns {vec2} out
   */
  
  function normalize(out, a) {
    var x = a[0],
        y = a[1];
    var len = x * x + y * y;
  
    if (len > 0) {
      //TODO: evaluate use of glm_invsqrt here?
      len = 1 / Math.sqrt(len);
    }
  
    out[0] = a[0] * len;
    out[1] = a[1] * len;
    return out;
  }
  /**
   * Calculates the dot product of two vec2's
   *
   * @param {vec2} a the first operand
   * @param {vec2} b the second operand
   * @returns {Number} dot product of a and b
   */
  
  function dot(a, b) {
    return a[0] * b[0] + a[1] * b[1];
  }
  /**
   * Computes the cross product of two vec2's
   * Note that the cross product must by definition produce a 3D vector
   *
   * @param {vec3} out the receiving vector
   * @param {vec2} a the first operand
   * @param {vec2} b the second operand
   * @returns {vec3} out
   */
  
  function cross(out, a, b) {
    var z = a[0] * b[1] - a[1] * b[0];
    out[0] = out[1] = 0;
    out[2] = z;
    return out;
  }
  /**
   * Performs a linear interpolation between two vec2's
   *
   * @param {vec2} out the receiving vector
   * @param {vec2} a the first operand
   * @param {vec2} b the second operand
   * @param {Number} t interpolation amount, in the range [0-1], between the two inputs
   * @returns {vec2} out
   */
  
  function lerp(out, a, b, t) {
    var ax = a[0],
        ay = a[1];
    out[0] = ax + t * (b[0] - ax);
    out[1] = ay + t * (b[1] - ay);
    return out;
  }
  /**
   * Generates a random vector with the given scale
   *
   * @param {vec2} out the receiving vector
   * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned
   * @returns {vec2} out
   */
  
  function random(out, scale) {
    scale = scale || 1.0;
    var r = _common_js__WEBPACK_IMPORTED_MODULE_0__["RANDOM"]() * 2.0 * Math.PI;
    out[0] = Math.cos(r) * scale;
    out[1] = Math.sin(r) * scale;
    return out;
  }
  /**
   * Transforms the vec2 with a mat2
   *
   * @param {vec2} out the receiving vector
   * @param {vec2} a the vector to transform
   * @param {mat2} m matrix to transform with
   * @returns {vec2} out
   */
  
  function transformMat2(out, a, m) {
    var x = a[0],
        y = a[1];
    out[0] = m[0] * x + m[2] * y;
    out[1] = m[1] * x + m[3] * y;
    return out;
  }
  /**
   * Transforms the vec2 with a mat2d
   *
   * @param {vec2} out the receiving vector
   * @param {vec2} a the vector to transform
   * @param {mat2d} m matrix to transform with
   * @returns {vec2} out
   */
  
  function transformMat2d(out, a, m) {
    var x = a[0],
        y = a[1];
    out[0] = m[0] * x + m[2] * y + m[4];
    out[1] = m[1] * x + m[3] * y + m[5];
    return out;
  }
  /**
   * Transforms the vec2 with a mat3
   * 3rd vector component is implicitly '1'
   *
   * @param {vec2} out the receiving vector
   * @param {vec2} a the vector to transform
   * @param {mat3} m matrix to transform with
   * @returns {vec2} out
   */
  
  function transformMat3(out, a, m) {
    var x = a[0],
        y = a[1];
    out[0] = m[0] * x + m[3] * y + m[6];
    out[1] = m[1] * x + m[4] * y + m[7];
    return out;
  }
  /**
   * Transforms the vec2 with a mat4
   * 3rd vector component is implicitly '0'
   * 4th vector component is implicitly '1'
   *
   * @param {vec2} out the receiving vector
   * @param {vec2} a the vector to transform
   * @param {mat4} m matrix to transform with
   * @returns {vec2} out
   */
  
  function transformMat4(out, a, m) {
    var x = a[0];
    var y = a[1];
    out[0] = m[0] * x + m[4] * y + m[12];
    out[1] = m[1] * x + m[5] * y + m[13];
    return out;
  }
  /**
   * Rotate a 2D vector
   * @param {vec2} out The receiving vec2
   * @param {vec2} a The vec2 point to rotate
   * @param {vec2} b The origin of the rotation
   * @param {Number} c The angle of rotation
   * @returns {vec2} out
   */
  
  function rotate(out, a, b, c) {
    //Translate point to the origin
    var p0 = a[0] - b[0],
        p1 = a[1] - b[1],
        sinC = Math.sin(c),
        cosC = Math.cos(c); //perform rotation and translate to correct position
  
    out[0] = p0 * cosC - p1 * sinC + b[0];
    out[1] = p0 * sinC + p1 * cosC + b[1];
    return out;
  }
  /**
   * Get the angle between two 2D vectors
   * @param {vec2} a The first operand
   * @param {vec2} b The second operand
   * @returns {Number} The angle in radians
   */
  
  function angle(a, b) {
    var x1 = a[0],
        y1 = a[1],
        x2 = b[0],
        y2 = b[1];
    var len1 = x1 * x1 + y1 * y1;
  
    if (len1 > 0) {
      //TODO: evaluate use of glm_invsqrt here?
      len1 = 1 / Math.sqrt(len1);
    }
  
    var len2 = x2 * x2 + y2 * y2;
  
    if (len2 > 0) {
      //TODO: evaluate use of glm_invsqrt here?
      len2 = 1 / Math.sqrt(len2);
    }
  
    var cosine = (x1 * x2 + y1 * y2) * len1 * len2;
  
    if (cosine > 1.0) {
      return 0;
    } else if (cosine < -1.0) {
      return Math.PI;
    } else {
      return Math.acos(cosine);
    }
  }
  /**
   * Set the components of a vec2 to zero
   *
   * @param {vec2} out the receiving vector
   * @returns {vec2} out
   */
  
  function zero(out) {
    out[0] = 0.0;
    out[1] = 0.0;
    return out;
  }
  /**
   * Returns a string representation of a vector
   *
   * @param {vec2} a vector to represent as a string
   * @returns {String} string representation of the vector
   */
  
  function str(a) {
    return 'vec2(' + a[0] + ', ' + a[1] + ')';
  }
  /**
   * Returns whether or not the vectors exactly have the same elements in the same position (when compared with ===)
   *
   * @param {vec2} a The first vector.
   * @param {vec2} b The second vector.
   * @returns {Boolean} True if the vectors are equal, false otherwise.
   */
  
  function exactEquals(a, b) {
    return a[0] === b[0] && a[1] === b[1];
  }
  /**
   * Returns whether or not the vectors have approximately the same elements in the same position.
   *
   * @param {vec2} a The first vector.
   * @param {vec2} b The second vector.
   * @returns {Boolean} True if the vectors are equal, false otherwise.
   */
  
  function equals(a, b) {
    var a0 = a[0],
        a1 = a[1];
    var b0 = b[0],
        b1 = b[1];
    return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a1), Math.abs(b1));
  }
  /**
   * Alias for {@link vec2.length}
   * @function
   */
  
  var len = length;
  /**
   * Alias for {@link vec2.subtract}
   * @function
   */
  
  var sub = subtract;
  /**
   * Alias for {@link vec2.multiply}
   * @function
   */
  
  var mul = multiply;
  /**
   * Alias for {@link vec2.divide}
   * @function
   */
  
  var div = divide;
  /**
   * Alias for {@link vec2.distance}
   * @function
   */
  
  var dist = distance;
  /**
   * Alias for {@link vec2.squaredDistance}
   * @function
   */
  
  var sqrDist = squaredDistance;
  /**
   * Alias for {@link vec2.squaredLength}
   * @function
   */
  
  var sqrLen = squaredLength;
  /**
   * Perform some operation over an array of vec2s.
   *
   * @param {Array} a the array of vectors to iterate over
   * @param {Number} stride Number of elements between the start of each vec2. If 0 assumes tightly packed
   * @param {Number} offset Number of elements to skip at the beginning of the array
   * @param {Number} count Number of vec2s to iterate over. If 0 iterates over entire array
   * @param {Function} fn Function to call for each vector in the array
   * @param {Object} [arg] additional argument to pass to fn
   * @returns {Array} a
   * @function
   */
  
  var forEach = function () {
    var vec = create();
    return function (a, stride, offset, count, fn, arg) {
      var i, l;
  
      if (!stride) {
        stride = 2;
      }
  
      if (!offset) {
        offset = 0;
      }
  
      if (count) {
        l = Math.min(count * stride + offset, a.length);
      } else {
        l = a.length;
      }
  
      for (i = offset; i < l; i += stride) {
        vec[0] = a[i];
        vec[1] = a[i + 1];
        fn(vec, vec, arg);
        a[i] = vec[0];
        a[i + 1] = vec[1];
      }
  
      return a;
    };
  }();
  
  /***/ }),
  
  /***/ "../../node_modules/gl-matrix/esm/vec3.js":
  /*!************************************************************************!*\
    !*** /Users/xintong/dev/loaders.gl/node_modules/gl-matrix/esm/vec3.js ***!
    \************************************************************************/
  /*! exports provided: create, clone, length, fromValues, copy, set, add, subtract, multiply, divide, ceil, floor, min, max, round, scale, scaleAndAdd, distance, squaredDistance, squaredLength, negate, inverse, normalize, dot, cross, lerp, hermite, bezier, random, transformMat4, transformMat3, transformQuat, rotateX, rotateY, rotateZ, angle, zero, str, exactEquals, equals, sub, mul, div, dist, sqrDist, len, sqrLen, forEach */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "create", function() { return create; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "clone", function() { return clone; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "length", function() { return length; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromValues", function() { return fromValues; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "copy", function() { return copy; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "set", function() { return set; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "add", function() { return add; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "subtract", function() { return subtract; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "multiply", function() { return multiply; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "divide", function() { return divide; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ceil", function() { return ceil; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "floor", function() { return floor; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "min", function() { return min; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "max", function() { return max; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "round", function() { return round; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scale", function() { return scale; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scaleAndAdd", function() { return scaleAndAdd; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "distance", function() { return distance; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "squaredDistance", function() { return squaredDistance; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "squaredLength", function() { return squaredLength; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "negate", function() { return negate; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "inverse", function() { return inverse; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalize", function() { return normalize; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dot", function() { return dot; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cross", function() { return cross; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lerp", function() { return lerp; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hermite", function() { return hermite; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "bezier", function() { return bezier; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "random", function() { return random; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "transformMat4", function() { return transformMat4; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "transformMat3", function() { return transformMat3; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "transformQuat", function() { return transformQuat; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rotateX", function() { return rotateX; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rotateY", function() { return rotateY; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rotateZ", function() { return rotateZ; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "angle", function() { return angle; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "zero", function() { return zero; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "str", function() { return str; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "exactEquals", function() { return exactEquals; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "equals", function() { return equals; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sub", function() { return sub; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mul", function() { return mul; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "div", function() { return div; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dist", function() { return dist; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sqrDist", function() { return sqrDist; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "len", function() { return len; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sqrLen", function() { return sqrLen; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "forEach", function() { return forEach; });
  /* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common.js */ "../../node_modules/gl-matrix/esm/common.js");
  
  /**
   * 3 Dimensional Vector
   * @module vec3
   */
  
  /**
   * Creates a new, empty vec3
   *
   * @returns {vec3} a new 3D vector
   */
  
  function create() {
    var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"](3);
  
    if (_common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"] != Float32Array) {
      out[0] = 0;
      out[1] = 0;
      out[2] = 0;
    }
  
    return out;
  }
  /**
   * Creates a new vec3 initialized with values from an existing vector
   *
   * @param {vec3} a vector to clone
   * @returns {vec3} a new 3D vector
   */
  
  function clone(a) {
    var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"](3);
    out[0] = a[0];
    out[1] = a[1];
    out[2] = a[2];
    return out;
  }
  /**
   * Calculates the length of a vec3
   *
   * @param {vec3} a vector to calculate length of
   * @returns {Number} length of a
   */
  
  function length(a) {
    var x = a[0];
    var y = a[1];
    var z = a[2];
    return Math.hypot(x, y, z);
  }
  /**
   * Creates a new vec3 initialized with the given values
   *
   * @param {Number} x X component
   * @param {Number} y Y component
   * @param {Number} z Z component
   * @returns {vec3} a new 3D vector
   */
  
  function fromValues(x, y, z) {
    var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"](3);
    out[0] = x;
    out[1] = y;
    out[2] = z;
    return out;
  }
  /**
   * Copy the values from one vec3 to another
   *
   * @param {vec3} out the receiving vector
   * @param {vec3} a the source vector
   * @returns {vec3} out
   */
  
  function copy(out, a) {
    out[0] = a[0];
    out[1] = a[1];
    out[2] = a[2];
    return out;
  }
  /**
   * Set the components of a vec3 to the given values
   *
   * @param {vec3} out the receiving vector
   * @param {Number} x X component
   * @param {Number} y Y component
   * @param {Number} z Z component
   * @returns {vec3} out
   */
  
  function set(out, x, y, z) {
    out[0] = x;
    out[1] = y;
    out[2] = z;
    return out;
  }
  /**
   * Adds two vec3's
   *
   * @param {vec3} out the receiving vector
   * @param {vec3} a the first operand
   * @param {vec3} b the second operand
   * @returns {vec3} out
   */
  
  function add(out, a, b) {
    out[0] = a[0] + b[0];
    out[1] = a[1] + b[1];
    out[2] = a[2] + b[2];
    return out;
  }
  /**
   * Subtracts vector b from vector a
   *
   * @param {vec3} out the receiving vector
   * @param {vec3} a the first operand
   * @param {vec3} b the second operand
   * @returns {vec3} out
   */
  
  function subtract(out, a, b) {
    out[0] = a[0] - b[0];
    out[1] = a[1] - b[1];
    out[2] = a[2] - b[2];
    return out;
  }
  /**
   * Multiplies two vec3's
   *
   * @param {vec3} out the receiving vector
   * @param {vec3} a the first operand
   * @param {vec3} b the second operand
   * @returns {vec3} out
   */
  
  function multiply(out, a, b) {
    out[0] = a[0] * b[0];
    out[1] = a[1] * b[1];
    out[2] = a[2] * b[2];
    return out;
  }
  /**
   * Divides two vec3's
   *
   * @param {vec3} out the receiving vector
   * @param {vec3} a the first operand
   * @param {vec3} b the second operand
   * @returns {vec3} out
   */
  
  function divide(out, a, b) {
    out[0] = a[0] / b[0];
    out[1] = a[1] / b[1];
    out[2] = a[2] / b[2];
    return out;
  }
  /**
   * Math.ceil the components of a vec3
   *
   * @param {vec3} out the receiving vector
   * @param {vec3} a vector to ceil
   * @returns {vec3} out
   */
  
  function ceil(out, a) {
    out[0] = Math.ceil(a[0]);
    out[1] = Math.ceil(a[1]);
    out[2] = Math.ceil(a[2]);
    return out;
  }
  /**
   * Math.floor the components of a vec3
   *
   * @param {vec3} out the receiving vector
   * @param {vec3} a vector to floor
   * @returns {vec3} out
   */
  
  function floor(out, a) {
    out[0] = Math.floor(a[0]);
    out[1] = Math.floor(a[1]);
    out[2] = Math.floor(a[2]);
    return out;
  }
  /**
   * Returns the minimum of two vec3's
   *
   * @param {vec3} out the receiving vector
   * @param {vec3} a the first operand
   * @param {vec3} b the second operand
   * @returns {vec3} out
   */
  
  function min(out, a, b) {
    out[0] = Math.min(a[0], b[0]);
    out[1] = Math.min(a[1], b[1]);
    out[2] = Math.min(a[2], b[2]);
    return out;
  }
  /**
   * Returns the maximum of two vec3's
   *
   * @param {vec3} out the receiving vector
   * @param {vec3} a the first operand
   * @param {vec3} b the second operand
   * @returns {vec3} out
   */
  
  function max(out, a, b) {
    out[0] = Math.max(a[0], b[0]);
    out[1] = Math.max(a[1], b[1]);
    out[2] = Math.max(a[2], b[2]);
    return out;
  }
  /**
   * Math.round the components of a vec3
   *
   * @param {vec3} out the receiving vector
   * @param {vec3} a vector to round
   * @returns {vec3} out
   */
  
  function round(out, a) {
    out[0] = Math.round(a[0]);
    out[1] = Math.round(a[1]);
    out[2] = Math.round(a[2]);
    return out;
  }
  /**
   * Scales a vec3 by a scalar number
   *
   * @param {vec3} out the receiving vector
   * @param {vec3} a the vector to scale
   * @param {Number} b amount to scale the vector by
   * @returns {vec3} out
   */
  
  function scale(out, a, b) {
    out[0] = a[0] * b;
    out[1] = a[1] * b;
    out[2] = a[2] * b;
    return out;
  }
  /**
   * Adds two vec3's after scaling the second operand by a scalar value
   *
   * @param {vec3} out the receiving vector
   * @param {vec3} a the first operand
   * @param {vec3} b the second operand
   * @param {Number} scale the amount to scale b by before adding
   * @returns {vec3} out
   */
  
  function scaleAndAdd(out, a, b, scale) {
    out[0] = a[0] + b[0] * scale;
    out[1] = a[1] + b[1] * scale;
    out[2] = a[2] + b[2] * scale;
    return out;
  }
  /**
   * Calculates the euclidian distance between two vec3's
   *
   * @param {vec3} a the first operand
   * @param {vec3} b the second operand
   * @returns {Number} distance between a and b
   */
  
  function distance(a, b) {
    var x = b[0] - a[0];
    var y = b[1] - a[1];
    var z = b[2] - a[2];
    return Math.hypot(x, y, z);
  }
  /**
   * Calculates the squared euclidian distance between two vec3's
   *
   * @param {vec3} a the first operand
   * @param {vec3} b the second operand
   * @returns {Number} squared distance between a and b
   */
  
  function squaredDistance(a, b) {
    var x = b[0] - a[0];
    var y = b[1] - a[1];
    var z = b[2] - a[2];
    return x * x + y * y + z * z;
  }
  /**
   * Calculates the squared length of a vec3
   *
   * @param {vec3} a vector to calculate squared length of
   * @returns {Number} squared length of a
   */
  
  function squaredLength(a) {
    var x = a[0];
    var y = a[1];
    var z = a[2];
    return x * x + y * y + z * z;
  }
  /**
   * Negates the components of a vec3
   *
   * @param {vec3} out the receiving vector
   * @param {vec3} a vector to negate
   * @returns {vec3} out
   */
  
  function negate(out, a) {
    out[0] = -a[0];
    out[1] = -a[1];
    out[2] = -a[2];
    return out;
  }
  /**
   * Returns the inverse of the components of a vec3
   *
   * @param {vec3} out the receiving vector
   * @param {vec3} a vector to invert
   * @returns {vec3} out
   */
  
  function inverse(out, a) {
    out[0] = 1.0 / a[0];
    out[1] = 1.0 / a[1];
    out[2] = 1.0 / a[2];
    return out;
  }
  /**
   * Normalize a vec3
   *
   * @param {vec3} out the receiving vector
   * @param {vec3} a vector to normalize
   * @returns {vec3} out
   */
  
  function normalize(out, a) {
    var x = a[0];
    var y = a[1];
    var z = a[2];
    var len = x * x + y * y + z * z;
  
    if (len > 0) {
      //TODO: evaluate use of glm_invsqrt here?
      len = 1 / Math.sqrt(len);
    }
  
    out[0] = a[0] * len;
    out[1] = a[1] * len;
    out[2] = a[2] * len;
    return out;
  }
  /**
   * Calculates the dot product of two vec3's
   *
   * @param {vec3} a the first operand
   * @param {vec3} b the second operand
   * @returns {Number} dot product of a and b
   */
  
  function dot(a, b) {
    return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];
  }
  /**
   * Computes the cross product of two vec3's
   *
   * @param {vec3} out the receiving vector
   * @param {vec3} a the first operand
   * @param {vec3} b the second operand
   * @returns {vec3} out
   */
  
  function cross(out, a, b) {
    var ax = a[0],
        ay = a[1],
        az = a[2];
    var bx = b[0],
        by = b[1],
        bz = b[2];
    out[0] = ay * bz - az * by;
    out[1] = az * bx - ax * bz;
    out[2] = ax * by - ay * bx;
    return out;
  }
  /**
   * Performs a linear interpolation between two vec3's
   *
   * @param {vec3} out the receiving vector
   * @param {vec3} a the first operand
   * @param {vec3} b the second operand
   * @param {Number} t interpolation amount, in the range [0-1], between the two inputs
   * @returns {vec3} out
   */
  
  function lerp(out, a, b, t) {
    var ax = a[0];
    var ay = a[1];
    var az = a[2];
    out[0] = ax + t * (b[0] - ax);
    out[1] = ay + t * (b[1] - ay);
    out[2] = az + t * (b[2] - az);
    return out;
  }
  /**
   * Performs a hermite interpolation with two control points
   *
   * @param {vec3} out the receiving vector
   * @param {vec3} a the first operand
   * @param {vec3} b the second operand
   * @param {vec3} c the third operand
   * @param {vec3} d the fourth operand
   * @param {Number} t interpolation amount, in the range [0-1], between the two inputs
   * @returns {vec3} out
   */
  
  function hermite(out, a, b, c, d, t) {
    var factorTimes2 = t * t;
    var factor1 = factorTimes2 * (2 * t - 3) + 1;
    var factor2 = factorTimes2 * (t - 2) + t;
    var factor3 = factorTimes2 * (t - 1);
    var factor4 = factorTimes2 * (3 - 2 * t);
    out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;
    out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;
    out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;
    return out;
  }
  /**
   * Performs a bezier interpolation with two control points
   *
   * @param {vec3} out the receiving vector
   * @param {vec3} a the first operand
   * @param {vec3} b the second operand
   * @param {vec3} c the third operand
   * @param {vec3} d the fourth operand
   * @param {Number} t interpolation amount, in the range [0-1], between the two inputs
   * @returns {vec3} out
   */
  
  function bezier(out, a, b, c, d, t) {
    var inverseFactor = 1 - t;
    var inverseFactorTimesTwo = inverseFactor * inverseFactor;
    var factorTimes2 = t * t;
    var factor1 = inverseFactorTimesTwo * inverseFactor;
    var factor2 = 3 * t * inverseFactorTimesTwo;
    var factor3 = 3 * factorTimes2 * inverseFactor;
    var factor4 = factorTimes2 * t;
    out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;
    out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;
    out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;
    return out;
  }
  /**
   * Generates a random vector with the given scale
   *
   * @param {vec3} out the receiving vector
   * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned
   * @returns {vec3} out
   */
  
  function random(out, scale) {
    scale = scale || 1.0;
    var r = _common_js__WEBPACK_IMPORTED_MODULE_0__["RANDOM"]() * 2.0 * Math.PI;
    var z = _common_js__WEBPACK_IMPORTED_MODULE_0__["RANDOM"]() * 2.0 - 1.0;
    var zScale = Math.sqrt(1.0 - z * z) * scale;
    out[0] = Math.cos(r) * zScale;
    out[1] = Math.sin(r) * zScale;
    out[2] = z * scale;
    return out;
  }
  /**
   * Transforms the vec3 with a mat4.
   * 4th vector component is implicitly '1'
   *
   * @param {vec3} out the receiving vector
   * @param {vec3} a the vector to transform
   * @param {mat4} m matrix to transform with
   * @returns {vec3} out
   */
  
  function transformMat4(out, a, m) {
    var x = a[0],
        y = a[1],
        z = a[2];
    var w = m[3] * x + m[7] * y + m[11] * z + m[15];
    w = w || 1.0;
    out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;
    out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;
    out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;
    return out;
  }
  /**
   * Transforms the vec3 with a mat3.
   *
   * @param {vec3} out the receiving vector
   * @param {vec3} a the vector to transform
   * @param {mat3} m the 3x3 matrix to transform with
   * @returns {vec3} out
   */
  
  function transformMat3(out, a, m) {
    var x = a[0],
        y = a[1],
        z = a[2];
    out[0] = x * m[0] + y * m[3] + z * m[6];
    out[1] = x * m[1] + y * m[4] + z * m[7];
    out[2] = x * m[2] + y * m[5] + z * m[8];
    return out;
  }
  /**
   * Transforms the vec3 with a quat
   * Can also be used for dual quaternions. (Multiply it with the real part)
   *
   * @param {vec3} out the receiving vector
   * @param {vec3} a the vector to transform
   * @param {quat} q quaternion to transform with
   * @returns {vec3} out
   */
  
  function transformQuat(out, a, q) {
    // benchmarks: https://jsperf.com/quaternion-transform-vec3-implementations-fixed
    var qx = q[0],
        qy = q[1],
        qz = q[2],
        qw = q[3];
    var x = a[0],
        y = a[1],
        z = a[2]; // var qvec = [qx, qy, qz];
    // var uv = vec3.cross([], qvec, a);
  
    var uvx = qy * z - qz * y,
        uvy = qz * x - qx * z,
        uvz = qx * y - qy * x; // var uuv = vec3.cross([], qvec, uv);
  
    var uuvx = qy * uvz - qz * uvy,
        uuvy = qz * uvx - qx * uvz,
        uuvz = qx * uvy - qy * uvx; // vec3.scale(uv, uv, 2 * w);
  
    var w2 = qw * 2;
    uvx *= w2;
    uvy *= w2;
    uvz *= w2; // vec3.scale(uuv, uuv, 2);
  
    uuvx *= 2;
    uuvy *= 2;
    uuvz *= 2; // return vec3.add(out, a, vec3.add(out, uv, uuv));
  
    out[0] = x + uvx + uuvx;
    out[1] = y + uvy + uuvy;
    out[2] = z + uvz + uuvz;
    return out;
  }
  /**
   * Rotate a 3D vector around the x-axis
   * @param {vec3} out The receiving vec3
   * @param {vec3} a The vec3 point to rotate
   * @param {vec3} b The origin of the rotation
   * @param {Number} c The angle of rotation
   * @returns {vec3} out
   */
  
  function rotateX(out, a, b, c) {
    var p = [],
        r = []; //Translate point to the origin
  
    p[0] = a[0] - b[0];
    p[1] = a[1] - b[1];
    p[2] = a[2] - b[2]; //perform rotation
  
    r[0] = p[0];
    r[1] = p[1] * Math.cos(c) - p[2] * Math.sin(c);
    r[2] = p[1] * Math.sin(c) + p[2] * Math.cos(c); //translate to correct position
  
    out[0] = r[0] + b[0];
    out[1] = r[1] + b[1];
    out[2] = r[2] + b[2];
    return out;
  }
  /**
   * Rotate a 3D vector around the y-axis
   * @param {vec3} out The receiving vec3
   * @param {vec3} a The vec3 point to rotate
   * @param {vec3} b The origin of the rotation
   * @param {Number} c The angle of rotation
   * @returns {vec3} out
   */
  
  function rotateY(out, a, b, c) {
    var p = [],
        r = []; //Translate point to the origin
  
    p[0] = a[0] - b[0];
    p[1] = a[1] - b[1];
    p[2] = a[2] - b[2]; //perform rotation
  
    r[0] = p[2] * Math.sin(c) + p[0] * Math.cos(c);
    r[1] = p[1];
    r[2] = p[2] * Math.cos(c) - p[0] * Math.sin(c); //translate to correct position
  
    out[0] = r[0] + b[0];
    out[1] = r[1] + b[1];
    out[2] = r[2] + b[2];
    return out;
  }
  /**
   * Rotate a 3D vector around the z-axis
   * @param {vec3} out The receiving vec3
   * @param {vec3} a The vec3 point to rotate
   * @param {vec3} b The origin of the rotation
   * @param {Number} c The angle of rotation
   * @returns {vec3} out
   */
  
  function rotateZ(out, a, b, c) {
    var p = [],
        r = []; //Translate point to the origin
  
    p[0] = a[0] - b[0];
    p[1] = a[1] - b[1];
    p[2] = a[2] - b[2]; //perform rotation
  
    r[0] = p[0] * Math.cos(c) - p[1] * Math.sin(c);
    r[1] = p[0] * Math.sin(c) + p[1] * Math.cos(c);
    r[2] = p[2]; //translate to correct position
  
    out[0] = r[0] + b[0];
    out[1] = r[1] + b[1];
    out[2] = r[2] + b[2];
    return out;
  }
  /**
   * Get the angle between two 3D vectors
   * @param {vec3} a The first operand
   * @param {vec3} b The second operand
   * @returns {Number} The angle in radians
   */
  
  function angle(a, b) {
    var tempA = fromValues(a[0], a[1], a[2]);
    var tempB = fromValues(b[0], b[1], b[2]);
    normalize(tempA, tempA);
    normalize(tempB, tempB);
    var cosine = dot(tempA, tempB);
  
    if (cosine > 1.0) {
      return 0;
    } else if (cosine < -1.0) {
      return Math.PI;
    } else {
      return Math.acos(cosine);
    }
  }
  /**
   * Set the components of a vec3 to zero
   *
   * @param {vec3} out the receiving vector
   * @returns {vec3} out
   */
  
  function zero(out) {
    out[0] = 0.0;
    out[1] = 0.0;
    out[2] = 0.0;
    return out;
  }
  /**
   * Returns a string representation of a vector
   *
   * @param {vec3} a vector to represent as a string
   * @returns {String} string representation of the vector
   */
  
  function str(a) {
    return 'vec3(' + a[0] + ', ' + a[1] + ', ' + a[2] + ')';
  }
  /**
   * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)
   *
   * @param {vec3} a The first vector.
   * @param {vec3} b The second vector.
   * @returns {Boolean} True if the vectors are equal, false otherwise.
   */
  
  function exactEquals(a, b) {
    return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];
  }
  /**
   * Returns whether or not the vectors have approximately the same elements in the same position.
   *
   * @param {vec3} a The first vector.
   * @param {vec3} b The second vector.
   * @returns {Boolean} True if the vectors are equal, false otherwise.
   */
  
  function equals(a, b) {
    var a0 = a[0],
        a1 = a[1],
        a2 = a[2];
    var b0 = b[0],
        b1 = b[1],
        b2 = b[2];
    return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a2), Math.abs(b2));
  }
  /**
   * Alias for {@link vec3.subtract}
   * @function
   */
  
  var sub = subtract;
  /**
   * Alias for {@link vec3.multiply}
   * @function
   */
  
  var mul = multiply;
  /**
   * Alias for {@link vec3.divide}
   * @function
   */
  
  var div = divide;
  /**
   * Alias for {@link vec3.distance}
   * @function
   */
  
  var dist = distance;
  /**
   * Alias for {@link vec3.squaredDistance}
   * @function
   */
  
  var sqrDist = squaredDistance;
  /**
   * Alias for {@link vec3.length}
   * @function
   */
  
  var len = length;
  /**
   * Alias for {@link vec3.squaredLength}
   * @function
   */
  
  var sqrLen = squaredLength;
  /**
   * Perform some operation over an array of vec3s.
   *
   * @param {Array} a the array of vectors to iterate over
   * @param {Number} stride Number of elements between the start of each vec3. If 0 assumes tightly packed
   * @param {Number} offset Number of elements to skip at the beginning of the array
   * @param {Number} count Number of vec3s to iterate over. If 0 iterates over entire array
   * @param {Function} fn Function to call for each vector in the array
   * @param {Object} [arg] additional argument to pass to fn
   * @returns {Array} a
   * @function
   */
  
  var forEach = function () {
    var vec = create();
    return function (a, stride, offset, count, fn, arg) {
      var i, l;
  
      if (!stride) {
        stride = 3;
      }
  
      if (!offset) {
        offset = 0;
      }
  
      if (count) {
        l = Math.min(count * stride + offset, a.length);
      } else {
        l = a.length;
      }
  
      for (i = offset; i < l; i += stride) {
        vec[0] = a[i];
        vec[1] = a[i + 1];
        vec[2] = a[i + 2];
        fn(vec, vec, arg);
        a[i] = vec[0];
        a[i + 1] = vec[1];
        a[i + 2] = vec[2];
      }
  
      return a;
    };
  }();
  
  /***/ }),
  
  /***/ "../../node_modules/gl-matrix/esm/vec4.js":
  /*!************************************************************************!*\
    !*** /Users/xintong/dev/loaders.gl/node_modules/gl-matrix/esm/vec4.js ***!
    \************************************************************************/
  /*! exports provided: create, clone, fromValues, copy, set, add, subtract, multiply, divide, ceil, floor, min, max, round, scale, scaleAndAdd, distance, squaredDistance, length, squaredLength, negate, inverse, normalize, dot, cross, lerp, random, transformMat4, transformQuat, zero, str, exactEquals, equals, sub, mul, div, dist, sqrDist, len, sqrLen, forEach */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "create", function() { return create; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "clone", function() { return clone; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromValues", function() { return fromValues; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "copy", function() { return copy; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "set", function() { return set; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "add", function() { return add; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "subtract", function() { return subtract; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "multiply", function() { return multiply; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "divide", function() { return divide; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ceil", function() { return ceil; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "floor", function() { return floor; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "min", function() { return min; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "max", function() { return max; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "round", function() { return round; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scale", function() { return scale; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scaleAndAdd", function() { return scaleAndAdd; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "distance", function() { return distance; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "squaredDistance", function() { return squaredDistance; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "length", function() { return length; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "squaredLength", function() { return squaredLength; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "negate", function() { return negate; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "inverse", function() { return inverse; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalize", function() { return normalize; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dot", function() { return dot; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cross", function() { return cross; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lerp", function() { return lerp; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "random", function() { return random; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "transformMat4", function() { return transformMat4; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "transformQuat", function() { return transformQuat; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "zero", function() { return zero; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "str", function() { return str; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "exactEquals", function() { return exactEquals; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "equals", function() { return equals; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sub", function() { return sub; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mul", function() { return mul; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "div", function() { return div; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dist", function() { return dist; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sqrDist", function() { return sqrDist; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "len", function() { return len; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sqrLen", function() { return sqrLen; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "forEach", function() { return forEach; });
  /* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common.js */ "../../node_modules/gl-matrix/esm/common.js");
  
  /**
   * 4 Dimensional Vector
   * @module vec4
   */
  
  /**
   * Creates a new, empty vec4
   *
   * @returns {vec4} a new 4D vector
   */
  
  function create() {
    var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"](4);
  
    if (_common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"] != Float32Array) {
      out[0] = 0;
      out[1] = 0;
      out[2] = 0;
      out[3] = 0;
    }
  
    return out;
  }
  /**
   * Creates a new vec4 initialized with values from an existing vector
   *
   * @param {vec4} a vector to clone
   * @returns {vec4} a new 4D vector
   */
  
  function clone(a) {
    var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"](4);
    out[0] = a[0];
    out[1] = a[1];
    out[2] = a[2];
    out[3] = a[3];
    return out;
  }
  /**
   * Creates a new vec4 initialized with the given values
   *
   * @param {Number} x X component
   * @param {Number} y Y component
   * @param {Number} z Z component
   * @param {Number} w W component
   * @returns {vec4} a new 4D vector
   */
  
  function fromValues(x, y, z, w) {
    var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"](4);
    out[0] = x;
    out[1] = y;
    out[2] = z;
    out[3] = w;
    return out;
  }
  /**
   * Copy the values from one vec4 to another
   *
   * @param {vec4} out the receiving vector
   * @param {vec4} a the source vector
   * @returns {vec4} out
   */
  
  function copy(out, a) {
    out[0] = a[0];
    out[1] = a[1];
    out[2] = a[2];
    out[3] = a[3];
    return out;
  }
  /**
   * Set the components of a vec4 to the given values
   *
   * @param {vec4} out the receiving vector
   * @param {Number} x X component
   * @param {Number} y Y component
   * @param {Number} z Z component
   * @param {Number} w W component
   * @returns {vec4} out
   */
  
  function set(out, x, y, z, w) {
    out[0] = x;
    out[1] = y;
    out[2] = z;
    out[3] = w;
    return out;
  }
  /**
   * Adds two vec4's
   *
   * @param {vec4} out the receiving vector
   * @param {vec4} a the first operand
   * @param {vec4} b the second operand
   * @returns {vec4} out
   */
  
  function add(out, a, b) {
    out[0] = a[0] + b[0];
    out[1] = a[1] + b[1];
    out[2] = a[2] + b[2];
    out[3] = a[3] + b[3];
    return out;
  }
  /**
   * Subtracts vector b from vector a
   *
   * @param {vec4} out the receiving vector
   * @param {vec4} a the first operand
   * @param {vec4} b the second operand
   * @returns {vec4} out
   */
  
  function subtract(out, a, b) {
    out[0] = a[0] - b[0];
    out[1] = a[1] - b[1];
    out[2] = a[2] - b[2];
    out[3] = a[3] - b[3];
    return out;
  }
  /**
   * Multiplies two vec4's
   *
   * @param {vec4} out the receiving vector
   * @param {vec4} a the first operand
   * @param {vec4} b the second operand
   * @returns {vec4} out
   */
  
  function multiply(out, a, b) {
    out[0] = a[0] * b[0];
    out[1] = a[1] * b[1];
    out[2] = a[2] * b[2];
    out[3] = a[3] * b[3];
    return out;
  }
  /**
   * Divides two vec4's
   *
   * @param {vec4} out the receiving vector
   * @param {vec4} a the first operand
   * @param {vec4} b the second operand
   * @returns {vec4} out
   */
  
  function divide(out, a, b) {
    out[0] = a[0] / b[0];
    out[1] = a[1] / b[1];
    out[2] = a[2] / b[2];
    out[3] = a[3] / b[3];
    return out;
  }
  /**
   * Math.ceil the components of a vec4
   *
   * @param {vec4} out the receiving vector
   * @param {vec4} a vector to ceil
   * @returns {vec4} out
   */
  
  function ceil(out, a) {
    out[0] = Math.ceil(a[0]);
    out[1] = Math.ceil(a[1]);
    out[2] = Math.ceil(a[2]);
    out[3] = Math.ceil(a[3]);
    return out;
  }
  /**
   * Math.floor the components of a vec4
   *
   * @param {vec4} out the receiving vector
   * @param {vec4} a vector to floor
   * @returns {vec4} out
   */
  
  function floor(out, a) {
    out[0] = Math.floor(a[0]);
    out[1] = Math.floor(a[1]);
    out[2] = Math.floor(a[2]);
    out[3] = Math.floor(a[3]);
    return out;
  }
  /**
   * Returns the minimum of two vec4's
   *
   * @param {vec4} out the receiving vector
   * @param {vec4} a the first operand
   * @param {vec4} b the second operand
   * @returns {vec4} out
   */
  
  function min(out, a, b) {
    out[0] = Math.min(a[0], b[0]);
    out[1] = Math.min(a[1], b[1]);
    out[2] = Math.min(a[2], b[2]);
    out[3] = Math.min(a[3], b[3]);
    return out;
  }
  /**
   * Returns the maximum of two vec4's
   *
   * @param {vec4} out the receiving vector
   * @param {vec4} a the first operand
   * @param {vec4} b the second operand
   * @returns {vec4} out
   */
  
  function max(out, a, b) {
    out[0] = Math.max(a[0], b[0]);
    out[1] = Math.max(a[1], b[1]);
    out[2] = Math.max(a[2], b[2]);
    out[3] = Math.max(a[3], b[3]);
    return out;
  }
  /**
   * Math.round the components of a vec4
   *
   * @param {vec4} out the receiving vector
   * @param {vec4} a vector to round
   * @returns {vec4} out
   */
  
  function round(out, a) {
    out[0] = Math.round(a[0]);
    out[1] = Math.round(a[1]);
    out[2] = Math.round(a[2]);
    out[3] = Math.round(a[3]);
    return out;
  }
  /**
   * Scales a vec4 by a scalar number
   *
   * @param {vec4} out the receiving vector
   * @param {vec4} a the vector to scale
   * @param {Number} b amount to scale the vector by
   * @returns {vec4} out
   */
  
  function scale(out, a, b) {
    out[0] = a[0] * b;
    out[1] = a[1] * b;
    out[2] = a[2] * b;
    out[3] = a[3] * b;
    return out;
  }
  /**
   * Adds two vec4's after scaling the second operand by a scalar value
   *
   * @param {vec4} out the receiving vector
   * @param {vec4} a the first operand
   * @param {vec4} b the second operand
   * @param {Number} scale the amount to scale b by before adding
   * @returns {vec4} out
   */
  
  function scaleAndAdd(out, a, b, scale) {
    out[0] = a[0] + b[0] * scale;
    out[1] = a[1] + b[1] * scale;
    out[2] = a[2] + b[2] * scale;
    out[3] = a[3] + b[3] * scale;
    return out;
  }
  /**
   * Calculates the euclidian distance between two vec4's
   *
   * @param {vec4} a the first operand
   * @param {vec4} b the second operand
   * @returns {Number} distance between a and b
   */
  
  function distance(a, b) {
    var x = b[0] - a[0];
    var y = b[1] - a[1];
    var z = b[2] - a[2];
    var w = b[3] - a[3];
    return Math.hypot(x, y, z, w);
  }
  /**
   * Calculates the squared euclidian distance between two vec4's
   *
   * @param {vec4} a the first operand
   * @param {vec4} b the second operand
   * @returns {Number} squared distance between a and b
   */
  
  function squaredDistance(a, b) {
    var x = b[0] - a[0];
    var y = b[1] - a[1];
    var z = b[2] - a[2];
    var w = b[3] - a[3];
    return x * x + y * y + z * z + w * w;
  }
  /**
   * Calculates the length of a vec4
   *
   * @param {vec4} a vector to calculate length of
   * @returns {Number} length of a
   */
  
  function length(a) {
    var x = a[0];
    var y = a[1];
    var z = a[2];
    var w = a[3];
    return Math.hypot(x, y, z, w);
  }
  /**
   * Calculates the squared length of a vec4
   *
   * @param {vec4} a vector to calculate squared length of
   * @returns {Number} squared length of a
   */
  
  function squaredLength(a) {
    var x = a[0];
    var y = a[1];
    var z = a[2];
    var w = a[3];
    return x * x + y * y + z * z + w * w;
  }
  /**
   * Negates the components of a vec4
   *
   * @param {vec4} out the receiving vector
   * @param {vec4} a vector to negate
   * @returns {vec4} out
   */
  
  function negate(out, a) {
    out[0] = -a[0];
    out[1] = -a[1];
    out[2] = -a[2];
    out[3] = -a[3];
    return out;
  }
  /**
   * Returns the inverse of the components of a vec4
   *
   * @param {vec4} out the receiving vector
   * @param {vec4} a vector to invert
   * @returns {vec4} out
   */
  
  function inverse(out, a) {
    out[0] = 1.0 / a[0];
    out[1] = 1.0 / a[1];
    out[2] = 1.0 / a[2];
    out[3] = 1.0 / a[3];
    return out;
  }
  /**
   * Normalize a vec4
   *
   * @param {vec4} out the receiving vector
   * @param {vec4} a vector to normalize
   * @returns {vec4} out
   */
  
  function normalize(out, a) {
    var x = a[0];
    var y = a[1];
    var z = a[2];
    var w = a[3];
    var len = x * x + y * y + z * z + w * w;
  
    if (len > 0) {
      len = 1 / Math.sqrt(len);
    }
  
    out[0] = x * len;
    out[1] = y * len;
    out[2] = z * len;
    out[3] = w * len;
    return out;
  }
  /**
   * Calculates the dot product of two vec4's
   *
   * @param {vec4} a the first operand
   * @param {vec4} b the second operand
   * @returns {Number} dot product of a and b
   */
  
  function dot(a, b) {
    return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];
  }
  /**
   * Returns the cross-product of three vectors in a 4-dimensional space
   *
   * @param {vec4} result the receiving vector
   * @param {vec4} U the first vector
   * @param {vec4} V the second vector
   * @param {vec4} W the third vector
   * @returns {vec4} result
   */
  
  function cross(out, u, v, w) {
    var A = v[0] * w[1] - v[1] * w[0],
        B = v[0] * w[2] - v[2] * w[0],
        C = v[0] * w[3] - v[3] * w[0],
        D = v[1] * w[2] - v[2] * w[1],
        E = v[1] * w[3] - v[3] * w[1],
        F = v[2] * w[3] - v[3] * w[2];
    var G = u[0];
    var H = u[1];
    var I = u[2];
    var J = u[3];
    out[0] = H * F - I * E + J * D;
    out[1] = -(G * F) + I * C - J * B;
    out[2] = G * E - H * C + J * A;
    out[3] = -(G * D) + H * B - I * A;
    return out;
  }
  ;
  /**
   * Performs a linear interpolation between two vec4's
   *
   * @param {vec4} out the receiving vector
   * @param {vec4} a the first operand
   * @param {vec4} b the second operand
   * @param {Number} t interpolation amount, in the range [0-1], between the two inputs
   * @returns {vec4} out
   */
  
  function lerp(out, a, b, t) {
    var ax = a[0];
    var ay = a[1];
    var az = a[2];
    var aw = a[3];
    out[0] = ax + t * (b[0] - ax);
    out[1] = ay + t * (b[1] - ay);
    out[2] = az + t * (b[2] - az);
    out[3] = aw + t * (b[3] - aw);
    return out;
  }
  /**
   * Generates a random vector with the given scale
   *
   * @param {vec4} out the receiving vector
   * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned
   * @returns {vec4} out
   */
  
  function random(out, scale) {
    scale = scale || 1.0; // Marsaglia, George. Choosing a Point from the Surface of a
    // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646.
    // http://projecteuclid.org/euclid.aoms/1177692644;
  
    var v1, v2, v3, v4;
    var s1, s2;
  
    do {
      v1 = _common_js__WEBPACK_IMPORTED_MODULE_0__["RANDOM"]() * 2 - 1;
      v2 = _common_js__WEBPACK_IMPORTED_MODULE_0__["RANDOM"]() * 2 - 1;
      s1 = v1 * v1 + v2 * v2;
    } while (s1 >= 1);
  
    do {
      v3 = _common_js__WEBPACK_IMPORTED_MODULE_0__["RANDOM"]() * 2 - 1;
      v4 = _common_js__WEBPACK_IMPORTED_MODULE_0__["RANDOM"]() * 2 - 1;
      s2 = v3 * v3 + v4 * v4;
    } while (s2 >= 1);
  
    var d = Math.sqrt((1 - s1) / s2);
    out[0] = scale * v1;
    out[1] = scale * v2;
    out[2] = scale * v3 * d;
    out[3] = scale * v4 * d;
    return out;
  }
  /**
   * Transforms the vec4 with a mat4.
   *
   * @param {vec4} out the receiving vector
   * @param {vec4} a the vector to transform
   * @param {mat4} m matrix to transform with
   * @returns {vec4} out
   */
  
  function transformMat4(out, a, m) {
    var x = a[0],
        y = a[1],
        z = a[2],
        w = a[3];
    out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;
    out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;
    out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;
    out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;
    return out;
  }
  /**
   * Transforms the vec4 with a quat
   *
   * @param {vec4} out the receiving vector
   * @param {vec4} a the vector to transform
   * @param {quat} q quaternion to transform with
   * @returns {vec4} out
   */
  
  function transformQuat(out, a, q) {
    var x = a[0],
        y = a[1],
        z = a[2];
    var qx = q[0],
        qy = q[1],
        qz = q[2],
        qw = q[3]; // calculate quat * vec
  
    var ix = qw * x + qy * z - qz * y;
    var iy = qw * y + qz * x - qx * z;
    var iz = qw * z + qx * y - qy * x;
    var iw = -qx * x - qy * y - qz * z; // calculate result * inverse quat
  
    out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;
    out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;
    out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;
    out[3] = a[3];
    return out;
  }
  /**
   * Set the components of a vec4 to zero
   *
   * @param {vec4} out the receiving vector
   * @returns {vec4} out
   */
  
  function zero(out) {
    out[0] = 0.0;
    out[1] = 0.0;
    out[2] = 0.0;
    out[3] = 0.0;
    return out;
  }
  /**
   * Returns a string representation of a vector
   *
   * @param {vec4} a vector to represent as a string
   * @returns {String} string representation of the vector
   */
  
  function str(a) {
    return 'vec4(' + a[0] + ', ' + a[1] + ', ' + a[2] + ', ' + a[3] + ')';
  }
  /**
   * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)
   *
   * @param {vec4} a The first vector.
   * @param {vec4} b The second vector.
   * @returns {Boolean} True if the vectors are equal, false otherwise.
   */
  
  function exactEquals(a, b) {
    return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];
  }
  /**
   * Returns whether or not the vectors have approximately the same elements in the same position.
   *
   * @param {vec4} a The first vector.
   * @param {vec4} b The second vector.
   * @returns {Boolean} True if the vectors are equal, false otherwise.
   */
  
  function equals(a, b) {
    var a0 = a[0],
        a1 = a[1],
        a2 = a[2],
        a3 = a[3];
    var b0 = b[0],
        b1 = b[1],
        b2 = b[2],
        b3 = b[3];
    return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a3), Math.abs(b3));
  }
  /**
   * Alias for {@link vec4.subtract}
   * @function
   */
  
  var sub = subtract;
  /**
   * Alias for {@link vec4.multiply}
   * @function
   */
  
  var mul = multiply;
  /**
   * Alias for {@link vec4.divide}
   * @function
   */
  
  var div = divide;
  /**
   * Alias for {@link vec4.distance}
   * @function
   */
  
  var dist = distance;
  /**
   * Alias for {@link vec4.squaredDistance}
   * @function
   */
  
  var sqrDist = squaredDistance;
  /**
   * Alias for {@link vec4.length}
   * @function
   */
  
  var len = length;
  /**
   * Alias for {@link vec4.squaredLength}
   * @function
   */
  
  var sqrLen = squaredLength;
  /**
   * Perform some operation over an array of vec4s.
   *
   * @param {Array} a the array of vectors to iterate over
   * @param {Number} stride Number of elements between the start of each vec4. If 0 assumes tightly packed
   * @param {Number} offset Number of elements to skip at the beginning of the array
   * @param {Number} count Number of vec4s to iterate over. If 0 iterates over entire array
   * @param {Function} fn Function to call for each vector in the array
   * @param {Object} [arg] additional argument to pass to fn
   * @returns {Array} a
   * @function
   */
  
  var forEach = function () {
    var vec = create();
    return function (a, stride, offset, count, fn, arg) {
      var i, l;
  
      if (!stride) {
        stride = 4;
      }
  
      if (!offset) {
        offset = 0;
      }
  
      if (count) {
        l = Math.min(count * stride + offset, a.length);
      } else {
        l = a.length;
      }
  
      for (i = offset; i < l; i += stride) {
        vec[0] = a[i];
        vec[1] = a[i + 1];
        vec[2] = a[i + 2];
        vec[3] = a[i + 3];
        fn(vec, vec, arg);
        a[i] = vec[0];
        a[i + 1] = vec[1];
        a[i + 2] = vec[2];
        a[i + 3] = vec[3];
      }
  
      return a;
    };
  }();
  
  /***/ }),
  
  /***/ "../../node_modules/math.gl/dist/esm/index.js":
  /*!****************************************************************************!*\
    !*** /Users/xintong/dev/loaders.gl/node_modules/math.gl/dist/esm/index.js ***!
    \****************************************************************************/
  /*! exports provided: Vector2, Vector3, Vector4, Matrix3, Matrix4, Quaternion, config, configure, formatValue, isArray, clone, equals, exactEquals, toRadians, toDegrees, radians, degrees, sin, cos, tan, asin, acos, atan, clamp, lerp, _withEpsilon, checkNumber, _MathUtils, _SphericalCoordinates, _Pose, _Euler, _Polygon, assert */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony import */ var _math_gl_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @math.gl/core */ "../../node_modules/@math.gl/core/dist/esm/index.js");
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Vector2", function() { return _math_gl_core__WEBPACK_IMPORTED_MODULE_0__["Vector2"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Vector3", function() { return _math_gl_core__WEBPACK_IMPORTED_MODULE_0__["Vector3"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Vector4", function() { return _math_gl_core__WEBPACK_IMPORTED_MODULE_0__["Vector4"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Matrix3", function() { return _math_gl_core__WEBPACK_IMPORTED_MODULE_0__["Matrix3"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Matrix4", function() { return _math_gl_core__WEBPACK_IMPORTED_MODULE_0__["Matrix4"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Quaternion", function() { return _math_gl_core__WEBPACK_IMPORTED_MODULE_0__["Quaternion"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "config", function() { return _math_gl_core__WEBPACK_IMPORTED_MODULE_0__["config"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "configure", function() { return _math_gl_core__WEBPACK_IMPORTED_MODULE_0__["configure"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "formatValue", function() { return _math_gl_core__WEBPACK_IMPORTED_MODULE_0__["formatValue"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isArray", function() { return _math_gl_core__WEBPACK_IMPORTED_MODULE_0__["isArray"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "clone", function() { return _math_gl_core__WEBPACK_IMPORTED_MODULE_0__["clone"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "equals", function() { return _math_gl_core__WEBPACK_IMPORTED_MODULE_0__["equals"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "exactEquals", function() { return _math_gl_core__WEBPACK_IMPORTED_MODULE_0__["exactEquals"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toRadians", function() { return _math_gl_core__WEBPACK_IMPORTED_MODULE_0__["toRadians"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toDegrees", function() { return _math_gl_core__WEBPACK_IMPORTED_MODULE_0__["toDegrees"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "radians", function() { return _math_gl_core__WEBPACK_IMPORTED_MODULE_0__["radians"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "degrees", function() { return _math_gl_core__WEBPACK_IMPORTED_MODULE_0__["degrees"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sin", function() { return _math_gl_core__WEBPACK_IMPORTED_MODULE_0__["sin"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "cos", function() { return _math_gl_core__WEBPACK_IMPORTED_MODULE_0__["cos"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "tan", function() { return _math_gl_core__WEBPACK_IMPORTED_MODULE_0__["tan"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "asin", function() { return _math_gl_core__WEBPACK_IMPORTED_MODULE_0__["asin"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "acos", function() { return _math_gl_core__WEBPACK_IMPORTED_MODULE_0__["acos"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "atan", function() { return _math_gl_core__WEBPACK_IMPORTED_MODULE_0__["atan"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "clamp", function() { return _math_gl_core__WEBPACK_IMPORTED_MODULE_0__["clamp"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lerp", function() { return _math_gl_core__WEBPACK_IMPORTED_MODULE_0__["lerp"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_withEpsilon", function() { return _math_gl_core__WEBPACK_IMPORTED_MODULE_0__["_withEpsilon"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "checkNumber", function() { return _math_gl_core__WEBPACK_IMPORTED_MODULE_0__["checkNumber"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_MathUtils", function() { return _math_gl_core__WEBPACK_IMPORTED_MODULE_0__["_MathUtils"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_SphericalCoordinates", function() { return _math_gl_core__WEBPACK_IMPORTED_MODULE_0__["_SphericalCoordinates"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_Pose", function() { return _math_gl_core__WEBPACK_IMPORTED_MODULE_0__["_Pose"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_Euler", function() { return _math_gl_core__WEBPACK_IMPORTED_MODULE_0__["_Euler"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_Polygon", function() { return _math_gl_core__WEBPACK_IMPORTED_MODULE_0__["_Polygon"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "assert", function() { return _math_gl_core__WEBPACK_IMPORTED_MODULE_0__["assert"]; });
  
  
  //# sourceMappingURL=index.js.map
  
  /***/ }),
  
  /***/ "../../node_modules/process/browser.js":
  /*!*********************************************************************!*\
    !*** /Users/xintong/dev/loaders.gl/node_modules/process/browser.js ***!
    \*********************************************************************/
  /*! no static exports found */
  /***/ (function(module, exports) {
  
  // shim for using process in browser
  var process = module.exports = {};
  
  // cached from whatever global is present so that test runners that stub it
  // don't break things.  But we need to wrap it in a try catch in case it is
  // wrapped in strict mode code which doesn't define any globals.  It's inside a
  // function because try/catches deoptimize in certain engines.
  
  var cachedSetTimeout;
  var cachedClearTimeout;
  
  function defaultSetTimout() {
      throw new Error('setTimeout has not been defined');
  }
  function defaultClearTimeout () {
      throw new Error('clearTimeout has not been defined');
  }
  (function () {
      try {
          if (typeof setTimeout === 'function') {
              cachedSetTimeout = setTimeout;
          } else {
              cachedSetTimeout = defaultSetTimout;
          }
      } catch (e) {
          cachedSetTimeout = defaultSetTimout;
      }
      try {
          if (typeof clearTimeout === 'function') {
              cachedClearTimeout = clearTimeout;
          } else {
              cachedClearTimeout = defaultClearTimeout;
          }
      } catch (e) {
          cachedClearTimeout = defaultClearTimeout;
      }
  } ())
  function runTimeout(fun) {
      if (cachedSetTimeout === setTimeout) {
          //normal enviroments in sane situations
          return setTimeout(fun, 0);
      }
      // if setTimeout wasn't available but was latter defined
      if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
          cachedSetTimeout = setTimeout;
          return setTimeout(fun, 0);
      }
      try {
          // when when somebody has screwed with setTimeout but no I.E. maddness
          return cachedSetTimeout(fun, 0);
      } catch(e){
          try {
              // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
              return cachedSetTimeout.call(null, fun, 0);
          } catch(e){
              // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
              return cachedSetTimeout.call(this, fun, 0);
          }
      }
  
  
  }
  function runClearTimeout(marker) {
      if (cachedClearTimeout === clearTimeout) {
          //normal enviroments in sane situations
          return clearTimeout(marker);
      }
      // if clearTimeout wasn't available but was latter defined
      if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
          cachedClearTimeout = clearTimeout;
          return clearTimeout(marker);
      }
      try {
          // when when somebody has screwed with setTimeout but no I.E. maddness
          return cachedClearTimeout(marker);
      } catch (e){
          try {
              // When we are in I.E. but the script has been evaled so I.E. doesn't  trust the global object when called normally
              return cachedClearTimeout.call(null, marker);
          } catch (e){
              // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
              // Some versions of I.E. have different rules for clearTimeout vs setTimeout
              return cachedClearTimeout.call(this, marker);
          }
      }
  
  
  
  }
  var queue = [];
  var draining = false;
  var currentQueue;
  var queueIndex = -1;
  
  function cleanUpNextTick() {
      if (!draining || !currentQueue) {
          return;
      }
      draining = false;
      if (currentQueue.length) {
          queue = currentQueue.concat(queue);
      } else {
          queueIndex = -1;
      }
      if (queue.length) {
          drainQueue();
      }
  }
  
  function drainQueue() {
      if (draining) {
          return;
      }
      var timeout = runTimeout(cleanUpNextTick);
      draining = true;
  
      var len = queue.length;
      while(len) {
          currentQueue = queue;
          queue = [];
          while (++queueIndex < len) {
              if (currentQueue) {
                  currentQueue[queueIndex].run();
              }
          }
          queueIndex = -1;
          len = queue.length;
      }
      currentQueue = null;
      draining = false;
      runClearTimeout(timeout);
  }
  
  process.nextTick = function (fun) {
      var args = new Array(arguments.length - 1);
      if (arguments.length > 1) {
          for (var i = 1; i < arguments.length; i++) {
              args[i - 1] = arguments[i];
          }
      }
      queue.push(new Item(fun, args));
      if (queue.length === 1 && !draining) {
          runTimeout(drainQueue);
      }
  };
  
  // v8 likes predictible objects
  function Item(fun, array) {
      this.fun = fun;
      this.array = array;
  }
  Item.prototype.run = function () {
      this.fun.apply(null, this.array);
  };
  process.title = 'browser';
  process.browser = true;
  process.env = {};
  process.argv = [];
  process.version = ''; // empty string to avoid regexp issues
  process.versions = {};
  
  function noop() {}
  
  process.on = noop;
  process.addListener = noop;
  process.once = noop;
  process.off = noop;
  process.removeListener = noop;
  process.removeAllListeners = noop;
  process.emit = noop;
  process.prependListener = noop;
  process.prependOnceListener = noop;
  
  process.listeners = function (name) { return [] }
  
  process.binding = function (name) {
      throw new Error('process.binding is not supported');
  };
  
  process.cwd = function () { return '/' };
  process.chdir = function (dir) {
      throw new Error('process.chdir is not supported');
  };
  process.umask = function() { return 0; };
  
  
  /***/ }),
  
  /***/ "../../node_modules/webpack/buildin/global.js":
  /*!***********************************!*\
    !*** (webpack)/buildin/global.js ***!
    \***********************************/
  /*! no static exports found */
  /***/ (function(module, exports) {
  
  var g;
  
  // This works in non-strict mode
  g = (function() {
  	return this;
  })();
  
  try {
  	// This works if eval is allowed (see CSP)
  	g = g || new Function("return this")();
  } catch (e) {
  	// This works if the window reference is available
  	if (typeof window === "object") g = window;
  }
  
  // g can still be undefined, but nothing to do about it...
  // We return undefined, instead of nothing here, so it's
  // easier to handle this case. if(!global) { ...}
  
  module.exports = g;
  
  
  /***/ }),
  
  /***/ "../core/src/index.js":
  /*!****************************!*\
    !*** ../core/src/index.js ***!
    \****************************/
  /*! exports provided: fetchFile, readFileSync, writeFile, writeFileSync, setLoaderOptions, registerLoaders, parse, parseSync, parseInBatches, parseInBatchesSync, load, loadInBatches, encode, encodeSync, encodeInBatches, save, saveSync, isPromise, isIterable, isAsyncIterable, isIterator, isFetchResponse, isReadableStream, isWritableStream, toArrayBuffer, makeStreamIterator, forEach, lineAsyncIterator, textDecoderAsyncIterator, numberedLineAsyncIterator, makeChunkIterator, concatenateChunksAsync, isBrowser, isWorker, self, window, global, document, assert, setPathPrefix, getPathPrefix, resolvePath, _selectLoader, _WorkerThread, _WorkerFarm, _WorkerPool, _fetchProgress, _unregisterLoaders, contatenateAsyncIterator, getStreamIterator */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony import */ var _lib_fetch_fetch_file__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./lib/fetch/fetch-file */ "../core/src/lib/fetch/fetch-file.js");
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "fetchFile", function() { return _lib_fetch_fetch_file__WEBPACK_IMPORTED_MODULE_0__["fetchFile"]; });
  
  /* harmony import */ var _lib_fetch_read_file__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./lib/fetch/read-file */ "../core/src/lib/fetch/read-file.js");
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "readFileSync", function() { return _lib_fetch_read_file__WEBPACK_IMPORTED_MODULE_1__["readFileSync"]; });
  
  /* harmony import */ var _lib_fetch_write_file__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./lib/fetch/write-file */ "../core/src/lib/fetch/write-file.js");
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "writeFile", function() { return _lib_fetch_write_file__WEBPACK_IMPORTED_MODULE_2__["writeFile"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "writeFileSync", function() { return _lib_fetch_write_file__WEBPACK_IMPORTED_MODULE_2__["writeFileSync"]; });
  
  /* harmony import */ var _lib_set_loader_options__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./lib/set-loader-options */ "../core/src/lib/set-loader-options.js");
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setLoaderOptions", function() { return _lib_set_loader_options__WEBPACK_IMPORTED_MODULE_3__["setLoaderOptions"]; });
  
  /* harmony import */ var _lib_register_loaders__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./lib/register-loaders */ "../core/src/lib/register-loaders.js");
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "registerLoaders", function() { return _lib_register_loaders__WEBPACK_IMPORTED_MODULE_4__["registerLoaders"]; });
  
  /* harmony import */ var _lib_parse__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./lib/parse */ "../core/src/lib/parse.js");
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "parse", function() { return _lib_parse__WEBPACK_IMPORTED_MODULE_5__["parse"]; });
  
  /* harmony import */ var _lib_parse_sync__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./lib/parse-sync */ "../core/src/lib/parse-sync.js");
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "parseSync", function() { return _lib_parse_sync__WEBPACK_IMPORTED_MODULE_6__["parseSync"]; });
  
  /* harmony import */ var _lib_parse_in_batches__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./lib/parse-in-batches */ "../core/src/lib/parse-in-batches.js");
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "parseInBatches", function() { return _lib_parse_in_batches__WEBPACK_IMPORTED_MODULE_7__["parseInBatches"]; });
  
  /* harmony import */ var _lib_parse_in_batches_sync__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./lib/parse-in-batches-sync */ "../core/src/lib/parse-in-batches-sync.js");
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "parseInBatchesSync", function() { return _lib_parse_in_batches_sync__WEBPACK_IMPORTED_MODULE_8__["parseInBatchesSync"]; });
  
  /* harmony import */ var _lib_load__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./lib/load */ "../core/src/lib/load.js");
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "load", function() { return _lib_load__WEBPACK_IMPORTED_MODULE_9__["load"]; });
  
  /* harmony import */ var _lib_load_in_batches__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./lib/load-in-batches */ "../core/src/lib/load-in-batches.js");
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "loadInBatches", function() { return _lib_load_in_batches__WEBPACK_IMPORTED_MODULE_10__["loadInBatches"]; });
  
  /* harmony import */ var _lib_encode__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./lib/encode */ "../core/src/lib/encode.js");
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "encode", function() { return _lib_encode__WEBPACK_IMPORTED_MODULE_11__["encode"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "encodeSync", function() { return _lib_encode__WEBPACK_IMPORTED_MODULE_11__["encodeSync"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "encodeInBatches", function() { return _lib_encode__WEBPACK_IMPORTED_MODULE_11__["encodeInBatches"]; });
  
  /* harmony import */ var _lib_save__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./lib/save */ "../core/src/lib/save.js");
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "save", function() { return _lib_save__WEBPACK_IMPORTED_MODULE_12__["save"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "saveSync", function() { return _lib_save__WEBPACK_IMPORTED_MODULE_12__["saveSync"]; });
  
  /* harmony import */ var _javascript_utils_is_type__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./javascript-utils/is-type */ "../core/src/javascript-utils/is-type.js");
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isPromise", function() { return _javascript_utils_is_type__WEBPACK_IMPORTED_MODULE_13__["isPromise"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isIterable", function() { return _javascript_utils_is_type__WEBPACK_IMPORTED_MODULE_13__["isIterable"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isAsyncIterable", function() { return _javascript_utils_is_type__WEBPACK_IMPORTED_MODULE_13__["isAsyncIterable"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isIterator", function() { return _javascript_utils_is_type__WEBPACK_IMPORTED_MODULE_13__["isIterator"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isFetchResponse", function() { return _javascript_utils_is_type__WEBPACK_IMPORTED_MODULE_13__["isFetchResponse"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isReadableStream", function() { return _javascript_utils_is_type__WEBPACK_IMPORTED_MODULE_13__["isReadableStream"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isWritableStream", function() { return _javascript_utils_is_type__WEBPACK_IMPORTED_MODULE_13__["isWritableStream"]; });
  
  /* harmony import */ var _javascript_utils_binary_utils__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./javascript-utils/binary-utils */ "../core/src/javascript-utils/binary-utils.js");
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toArrayBuffer", function() { return _javascript_utils_binary_utils__WEBPACK_IMPORTED_MODULE_14__["toArrayBuffer"]; });
  
  /* harmony import */ var _iterator_utils_stream_iteration__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./iterator-utils/stream-iteration */ "../core/src/iterator-utils/stream-iteration.js");
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "makeStreamIterator", function() { return _iterator_utils_stream_iteration__WEBPACK_IMPORTED_MODULE_15__["makeStreamIterator"]; });
  
  /* harmony import */ var _iterator_utils_async_iteration__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./iterator-utils/async-iteration */ "../core/src/iterator-utils/async-iteration.js");
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forEach", function() { return _iterator_utils_async_iteration__WEBPACK_IMPORTED_MODULE_16__["forEach"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lineAsyncIterator", function() { return _iterator_utils_async_iteration__WEBPACK_IMPORTED_MODULE_16__["lineAsyncIterator"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "textDecoderAsyncIterator", function() { return _iterator_utils_async_iteration__WEBPACK_IMPORTED_MODULE_16__["textDecoderAsyncIterator"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "numberedLineAsyncIterator", function() { return _iterator_utils_async_iteration__WEBPACK_IMPORTED_MODULE_16__["numberedLineAsyncIterator"]; });
  
  /* harmony import */ var _iterator_utils_chunk_iteration__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./iterator-utils/chunk-iteration */ "../core/src/iterator-utils/chunk-iteration.js");
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "makeChunkIterator", function() { return _iterator_utils_chunk_iteration__WEBPACK_IMPORTED_MODULE_17__["makeChunkIterator"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "concatenateChunksAsync", function() { return _iterator_utils_chunk_iteration__WEBPACK_IMPORTED_MODULE_17__["concatenateChunksAsync"]; });
  
  /* harmony import */ var _loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @loaders.gl/loader-utils */ "../loader-utils/src/index.js");
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isBrowser", function() { return _loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_18__["isBrowser"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isWorker", function() { return _loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_18__["isWorker"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "self", function() { return _loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_18__["self"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "window", function() { return _loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_18__["window"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "global", function() { return _loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_18__["global"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "document", function() { return _loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_18__["document"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "assert", function() { return _loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_18__["assert"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setPathPrefix", function() { return _loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_18__["setPathPrefix"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getPathPrefix", function() { return _loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_18__["getPathPrefix"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "resolvePath", function() { return _loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_18__["resolvePath"]; });
  
  /* harmony import */ var _lib_select_loader__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./lib/select-loader */ "../core/src/lib/select-loader.js");
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_selectLoader", function() { return _lib_select_loader__WEBPACK_IMPORTED_MODULE_19__["selectLoader"]; });
  
  /* harmony import */ var _worker_utils_worker_thread__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./worker-utils/worker-thread */ "../core/src/worker-utils/worker-thread.js");
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_WorkerThread", function() { return _worker_utils_worker_thread__WEBPACK_IMPORTED_MODULE_20__["default"]; });
  
  /* harmony import */ var _worker_utils_worker_farm__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./worker-utils/worker-farm */ "../core/src/worker-utils/worker-farm.js");
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_WorkerFarm", function() { return _worker_utils_worker_farm__WEBPACK_IMPORTED_MODULE_21__["default"]; });
  
  /* harmony import */ var _worker_utils_worker_pool__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./worker-utils/worker-pool */ "../core/src/worker-utils/worker-pool.js");
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_WorkerPool", function() { return _worker_utils_worker_pool__WEBPACK_IMPORTED_MODULE_22__["default"]; });
  
  /* harmony import */ var _lib_progress_fetch_progress__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./lib/progress/fetch-progress */ "../core/src/lib/progress/fetch-progress.js");
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_fetchProgress", function() { return _lib_progress_fetch_progress__WEBPACK_IMPORTED_MODULE_23__["default"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_unregisterLoaders", function() { return _lib_register_loaders__WEBPACK_IMPORTED_MODULE_4__["_unregisterLoaders"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "contatenateAsyncIterator", function() { return _iterator_utils_chunk_iteration__WEBPACK_IMPORTED_MODULE_17__["concatenateChunksAsync"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getStreamIterator", function() { return _iterator_utils_stream_iteration__WEBPACK_IMPORTED_MODULE_15__["makeStreamIterator"]; });
  
  // FILE READING AND WRITING
  
  
  
  
  // CONFIGURATION
  
  
  
  // LOADING (READING + PARSING)
  
  
  
  
  
  
  
  
  // ENCODING (ENCODING AND WRITING)
  
  
  
  // "JAVASCRIPT" UTILS
  
  
  
  
  // ITERATOR UTILS
  
  
  
  
  
  
  // CORE UTILS SHARED WITH LOADERS (RE-EXPORTED FROM LOADER-UTILS)
  
  
  
  
  // EXPERIMENTAL
  
  
  
  
  
  
  
  
  // FOR TESTING
  
  
  // DEPRECATED in v2.1
  
  
  
  
  /***/ }),
  
  /***/ "../core/src/iterator-utils/async-iteration.js":
  /*!*****************************************************!*\
    !*** ../core/src/iterator-utils/async-iteration.js ***!
    \*****************************************************/
  /*! exports provided: forEach, textDecoderAsyncIterator, textEncoderAsyncIterator, lineAsyncIterator, numberedLineAsyncIterator */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "forEach", function() { return forEach; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "textDecoderAsyncIterator", function() { return textDecoderAsyncIterator; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "textEncoderAsyncIterator", function() { return textEncoderAsyncIterator; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lineAsyncIterator", function() { return lineAsyncIterator; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "numberedLineAsyncIterator", function() { return numberedLineAsyncIterator; });
  /* global TextDecoder, TextEncoder */
  
  // GENERAL UTILITIES
  
  /**
   * Iterate over async iterator, without resetting iterator if end is not reached
   * - forEach intentionally does not reset iterator if exiting loop prematurely
   *   so that iteration can continue in a second loop
   * - It is recommended to use a standard for-await as last loop to ensure
   *   iterator gets properly reset
   *
   * TODO - optimize using sync iteration if argument is an Iterable?
   *
   * @param iterator
   * @param visitor
   */
  async function forEach(iterator, visitor) {
    // eslint-disable-next-line
    while (true) {
      const {done, value} = await iterator.next();
      if (done) {
        iterator.return();
        return;
      }
      const cancel = visitor(value);
      if (cancel) {
        return;
      }
    }
  }
  
  // ITERATOR GENERATORS
  
  // TextDecoder iterators
  // TextDecoder will keep any partial undecoded bytes between calls to `decode`
  
  async function* textDecoderAsyncIterator(arrayBufferIterator, options) {
    const textDecoder = new TextDecoder(options);
    for await (const arrayBuffer of arrayBufferIterator) {
      yield typeof arrayBuffer === 'string'
        ? arrayBuffer
        : textDecoder.decode(arrayBuffer, {stream: true});
    }
  }
  
  // TextEncoder iterator
  // TODO - this is not useful unless min chunk size is given
  // TextEncoder will keep any partial undecoded bytes between calls to `encode`
  // If iterator does not yield strings, assume arrayBuffer and return unencoded
  
  async function* textEncoderAsyncIterator(textIterator, options) {
    const textEncoder = new TextEncoder();
    for await (const text of textIterator) {
      yield typeof text === 'string' ? textEncoder.encode(text) : text;
    }
  }
  
  /**
   * @param textIterator async iterable yielding strings
   * @returns an async iterable over lines
   * See http://2ality.com/2018/04/async-iter-nodejs.html
   */
  
  async function* lineAsyncIterator(textIterator) {
    let previous = '';
    for await (const textChunk of textIterator) {
      previous += textChunk;
      let eolIndex;
      while ((eolIndex = previous.indexOf('\n')) >= 0) {
        // line includes the EOL
        const line = previous.slice(0, eolIndex + 1);
        previous = previous.slice(eolIndex + 1);
        yield line;
      }
    }
  
    if (previous.length > 0) {
      yield previous;
    }
  }
  
  /**
   * @param lineIterator async iterable yielding lines
   * @returns async iterable yielding numbered lines
   *
   * See http://2ality.com/2018/04/async-iter-nodejs.html
   */
  async function* numberedLineAsyncIterator(lineIterator) {
    let counter = 1;
    for await (const line of lineIterator) {
      yield {counter, line};
      counter++;
    }
  }
  
  
  /***/ }),
  
  /***/ "../core/src/iterator-utils/chunk-iteration.js":
  /*!*****************************************************!*\
    !*** ../core/src/iterator-utils/chunk-iteration.js ***!
    \*****************************************************/
  /*! exports provided: concatenateChunksAsync, makeChunkIterator */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "concatenateChunksAsync", function() { return concatenateChunksAsync; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "makeChunkIterator", function() { return makeChunkIterator; });
  /* harmony import */ var _javascript_utils_memory_copy_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../javascript-utils/memory-copy-utils */ "../core/src/javascript-utils/memory-copy-utils.js");
  // Breaking big data into iterable chunks, concatenating iterable chunks into big data objects
  
  
  
  /**
   * Concatenates all data chunks yielded by an (async) iterator
   * Supports strings and ArrayBuffers
   *
   * This function can e.g. be used to enable atomic parsers to work on (async) iterator inputs
   */
  async function concatenateChunksAsync(asyncIterator) {
    let arrayBuffer = new ArrayBuffer(0);
    let string = '';
    for await (const chunk of asyncIterator) {
      if (typeof chunk === 'string') {
        string += chunk;
      } else {
        arrayBuffer = Object(_javascript_utils_memory_copy_utils__WEBPACK_IMPORTED_MODULE_0__["concatenateArrayBuffers"])(arrayBuffer, chunk);
      }
    }
    return string || arrayBuffer;
  }
  
  /**
   * Returns an iterator that breaks a big `ArrayBuffer` or string into chunks and yields them one-by-one.
   *
   * @param bigArrayBufferOrString
   * @param options
   * @param options.chunkSize
   * @returns iterator that yields chunks of specified size
   *
   * This function can e.g. be used to enable data sources that can only be read atomically
   * (such as `Blob` and `File` via `FileReader`) to still be parsed in batches.
   */
  function* makeChunkIterator(bigArrayBufferOrString, options = {}) {
    if (typeof bigArrayBufferOrString === 'string') {
      yield* makeStringChunkIterator(bigArrayBufferOrString, options);
      return;
    }
    if (bigArrayBufferOrString instanceof ArrayBuffer) {
      yield* makeArrayBufferChunkIterator(bigArrayBufferOrString, options);
      return;
    }
    throw new Error('assert');
  }
  
  /**
   * Helper: Breaks a big ArrayBuffer into chunks and returns an iterator that yields them one-by-one
   */
  function* makeArrayBufferChunkIterator(arrayBuffer, options = {}) {
    const {chunkSize = 256 * 1024} = options;
  
    let byteOffset = 0;
  
    while (byteOffset < arrayBuffer.byteLength) {
      // Create a chunk of the right size
      const chunkByteLength = Math.min(arrayBuffer.byteLength - byteOffset, chunkSize);
      const chunk = new ArrayBuffer(chunkByteLength);
  
      // Copy data from the big chunk
      const sourceArray = new Uint8Array(arrayBuffer, byteOffset, chunkByteLength);
      const chunkArray = new Uint8Array(chunk);
      chunkArray.set(sourceArray);
  
      // yield the chunk
      byteOffset += chunkByteLength;
      yield chunk;
    }
  }
  
  /**
   * Helper: Breaks a big string into chunks and returns an iterator that yields them one-by-one
   */
  function* makeStringChunkIterator(string, options = {}) {
    const {chunkSize = 256 * 1024} = options;
  
    let offset = 0;
  
    while (offset < string.length) {
      // Create a chunk of the right size
      const chunkLength = Math.min(string.length - offset, chunkSize);
      const chunk = string.slice(offset, offset + chunkLength);
      offset += chunkLength;
  
      // yield the chunk
      yield chunk;
    }
  }
  
  
  /***/ }),
  
  /***/ "../core/src/iterator-utils/stream-iteration.js":
  /*!******************************************************!*\
    !*** ../core/src/iterator-utils/stream-iteration.js ***!
    \******************************************************/
  /*! exports provided: makeStreamIterator */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "makeStreamIterator", function() { return makeStreamIterator; });
  /* harmony import */ var _loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @loaders.gl/loader-utils */ "../loader-utils/src/index.js");
  
  
  function makeStreamIterator(stream) {
    // Hacky test for node version to ensure we don't call bad polyfills
    if (_loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_0__["isBrowser"] || _loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_0__["nodeVersion"] >= 10) {
      // NODE 10+: stream is an asyncIterator
      if (typeof stream[Symbol.asyncIterator] === 'function') {
        return stream;
      }
  
      // WhatWG: stream is supposed to have a `getIterator` method
      if (typeof stream.getIterator === 'function') {
        return stream.getIterator();
      }
    }
  
    return _loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_0__["isBrowser"] ? makeBrowserStreamIterator(stream) : makeNodeStreamIterator(stream);
  }
  
  // BROWSER IMPLEMENTATION
  // See https://jakearchibald.com/2017/async-iterators-and-generators/#making-streams-iterate
  
  async function* makeBrowserStreamIterator(stream) {
    // In the brower, we first need to get a lock on the stream
    const reader = stream.getReader();
  
    try {
      // eslint-disable-next-line no-constant-condition
      while (true) {
        // Read from the stream
        const {done, value} = await reader.read();
        // Exit if we're done
        if (done) {
          return;
        }
        // Else yield the chunk
        yield value;
      }
    } catch (error) {
      // TODO - examples makes it look like this should always be called,
      // but that generates exceptions so only call it if we do not reach the end
      reader.releaseLock();
    }
  }
  
  // NODE <10 IMPLEMENTATION
  // See https://github.com/bustle/streaming-iterables, MIT license
  
  async function* makeNodeStreamIterator(stream) {
    // Node createStream will return promises to handle http requests
    stream = await stream;
  
    // eslint-disable-next-line no-constant-condition
    while (true) {
      const data = stream.read();
      if (data !== null) {
        yield data;
        // eslint-disable-next-line no-continue
        continue;
      }
      if (stream._readableState.ended) {
        return;
      }
      await onceReadable(stream);
    }
  }
  
  async function onceReadable(stream) {
    return new Promise(resolve => {
      stream.once('readable', resolve);
    });
  }
  
  // TODO - we could add our own polyfill
  // const {Readable} = require('stream');
  // if (typeof Readable !== 'undefined' && !Readable.prototype[Symbol.asyncIterator]) {
  //   Readable.prototype[Symbol.asyncIterator] = function () {
  //     return makeNodeStreamIterator(this);
  //   }
  // }
  
  
  /***/ }),
  
  /***/ "../core/src/javascript-utils/binary-utils.js":
  /*!****************************************************!*\
    !*** ../core/src/javascript-utils/binary-utils.js ***!
    \****************************************************/
  /*! exports provided: toArrayBuffer */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toArrayBuffer", function() { return toArrayBuffer; });
  /* harmony import */ var _loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @loaders.gl/loader-utils */ "../loader-utils/src/index.js");
  /* harmony import */ var _node_utils_to_array_buffer_node__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../node/utils/to-array-buffer.node */ 3);
  /* harmony import */ var _node_utils_to_array_buffer_node__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_utils_to_array_buffer_node__WEBPACK_IMPORTED_MODULE_1__);
  /* global TextEncoder */
  
  
  
  function toArrayBuffer(data) {
    if (_node_utils_to_array_buffer_node__WEBPACK_IMPORTED_MODULE_1__["toArrayBuffer"]) {
      // TODO - per docs we should just be able to call buffer.buffer, but there are issues
      data = Object(_node_utils_to_array_buffer_node__WEBPACK_IMPORTED_MODULE_1__["toArrayBuffer"])(data);
    }
  
    if (data instanceof ArrayBuffer) {
      return data;
    }
  
    // Careful - Node Buffers will look like ArrayBuffers (keep after isBuffer)
    if (ArrayBuffer.isView(data)) {
      return data.buffer;
    }
  
    if (typeof data === 'string') {
      const text = data;
      const uint8Array = new TextEncoder().encode(text);
      return uint8Array.buffer;
    }
  
    return Object(_loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_0__["assert"])(false);
  }
  
  // export function blobToArrayBuffer(blob) {
  //   return new Promise((resolve, reject) => {
  //     let arrayBuffer;
  //     const fileReader = new FileReader();
  //     fileReader.onload = event => {
  //       arrayBuffer = event.target.result;
  //     };
  //     fileReader.onloadend = event => resolve(arrayBuffer);
  //     fileReader.onerror = reject;
  //     fileReader.readAsArrayBuffer(blob);
  //   });
  // }
  
  
  /***/ }),
  
  /***/ "../core/src/javascript-utils/is-type.js":
  /*!***********************************************!*\
    !*** ../core/src/javascript-utils/is-type.js ***!
    \***********************************************/
  /*! exports provided: isPromise, isIterable, isAsyncIterable, isIterator, isFetchResponse, isFile, isBlob, isFileReadable, isWritableDOMStream, isReadableDOMStream, isBuffer, isWritableNodeStream, isReadableNodeStream, isReadableStream, isWritableStream */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isPromise", function() { return isPromise; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isIterable", function() { return isIterable; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isAsyncIterable", function() { return isAsyncIterable; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isIterator", function() { return isIterator; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isFetchResponse", function() { return isFetchResponse; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isFile", function() { return isFile; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isBlob", function() { return isBlob; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isFileReadable", function() { return isFileReadable; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isWritableDOMStream", function() { return isWritableDOMStream; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isReadableDOMStream", function() { return isReadableDOMStream; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isBuffer", function() { return isBuffer; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isWritableNodeStream", function() { return isWritableNodeStream; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isReadableNodeStream", function() { return isReadableNodeStream; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isReadableStream", function() { return isReadableStream; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isWritableStream", function() { return isWritableStream; });
  /* global File, Blob, Response, ReadableStream */
  
  const isBoolean = x => typeof x === 'boolean';
  const isFunction = x => typeof x === 'function';
  const isObject = x => x !== null && typeof x === 'object';
  
  const isPromise = x => isObject(x) && isFunction(x.then);
  
  const isIterable = x => x && typeof x[Symbol.iterator] === 'function';
  
  const isAsyncIterable = x => x && typeof x[Symbol.asyncIterator] === 'function';
  
  const isIterator = x => x && isFunction(x.next);
  
  const isFetchResponse = x =>
    (typeof Response !== 'undefined' && x instanceof Response) ||
    (x && x.arrayBuffer && x.text && x.json);
  
  const isFile = x => typeof File !== 'undefined' && x instanceof File;
  const isBlob = x => typeof Blob !== 'undefined' && x instanceof Blob;
  const isFileReadable = x => isFile(x) || isBlob(x); // Blob & File are FileReader compatible
  
  const isWritableDOMStream = x => {
    return isObject(x) && isFunction(x.abort) && isFunction(x.getWriter);
  };
  
  const isReadableDOMStream = x => {
    return (
      (typeof ReadableStream !== 'undefined' && x instanceof ReadableStream) ||
      (isObject(x) && isFunction(x.tee) && isFunction(x.cancel) && isFunction(x.getReader))
      // Not implemented in Firefox
      // && isFunction(x.pipeTo)
    );
  };
  
  // Check for Node.js `Buffer` without triggering bundler to include polyfill
  const isBuffer = x => x && typeof x === 'object' && x.isBuffer;
  
  const isWritableNodeStream = x => {
    return isObject(x) && isFunction(x.end) && isFunction(x.write) && isBoolean(x.writable);
  };
  
  const isReadableNodeStream = x => {
    return isObject(x) && isFunction(x.read) && isFunction(x.pipe) && isBoolean(x.readable);
  };
  
  const isReadableStream = x => isReadableDOMStream(x) || isReadableNodeStream(x);
  
  const isWritableStream = x => isWritableDOMStream(x) || isWritableNodeStream(x);
  
  
  /***/ }),
  
  /***/ "../core/src/javascript-utils/memory-copy-utils.js":
  /*!*********************************************************!*\
    !*** ../core/src/javascript-utils/memory-copy-utils.js ***!
    \*********************************************************/
  /*! exports provided: concatenateArrayBuffers */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "concatenateArrayBuffers", function() { return concatenateArrayBuffers; });
  function concatenateArrayBuffers(source1, source2) {
    const sourceArray1 = source1 instanceof ArrayBuffer ? new Uint8Array(source1) : source1;
    const sourceArray2 = source2 instanceof ArrayBuffer ? new Uint8Array(source2) : source2;
    const temp = new Uint8Array(sourceArray1.byteLength + sourceArray2.byteLength);
    temp.set(sourceArray1, 0);
    temp.set(sourceArray2, sourceArray1.byteLength);
    return temp;
  }
  
  
  /***/ }),
  
  /***/ "../core/src/lib/constants.js":
  /*!************************************!*\
    !*** ../core/src/lib/constants.js ***!
    \************************************/
  /*! exports provided: DEFAULT_LOADER_OPTIONS */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DEFAULT_LOADER_OPTIONS", function() { return DEFAULT_LOADER_OPTIONS; });
  /* harmony import */ var _loader_utils_loggers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./loader-utils/loggers */ "../core/src/lib/loader-utils/loggers.js");
  
  
  // TODO - document these options
  const DEFAULT_LOADER_OPTIONS = {
    CDN: 'https://unpkg.com/@loaders.gl',
    worker: true, // By default, use worker if provided by loader
    log: new _loader_utils_loggers__WEBPACK_IMPORTED_MODULE_0__["ConsoleLog"](), // A probe.gl compatible (`log.log()()` syntax) that just logs to console
    dataType: 'arraybuffer' // TODO - explain why this option is needed for parsing
  };
  
  
  /***/ }),
  
  /***/ "../core/src/lib/encode.js":
  /*!*********************************!*\
    !*** ../core/src/lib/encode.js ***!
    \*********************************/
  /*! exports provided: encode, encodeSync, encodeInBatches */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "encode", function() { return encode; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "encodeSync", function() { return encodeSync; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "encodeInBatches", function() { return encodeInBatches; });
  async function encode(data, writer, options, url) {
    if (writer.encode) {
      return await writer.encode(data, options);
    }
    if (writer.encodeSync) {
      return writer.encodeSync(data, options);
    }
    // TODO - Use encodeToBatches?
    throw new Error('Writer could not encode data');
  }
  
  function encodeSync(data, writer, options, url) {
    if (writer.encodeSync) {
      return writer.encodeSync(data, options);
    }
    throw new Error('Writer could not synchronously encode data');
  }
  
  function encodeInBatches(data, writer, options, url) {
    if (writer.encodeInBatches) {
      return writer.encodeInBatches(data, options);
    }
    // TODO -fall back to atomic encode?
    throw new Error('Writer could not encode data in batches');
  }
  
  
  /***/ }),
  
  /***/ "../core/src/lib/fetch/fetch-error-message.js":
  /*!****************************************************!*\
    !*** ../core/src/lib/fetch/fetch-error-message.js ***!
    \****************************************************/
  /*! exports provided: getErrorMessageFromResponseSync, getErrorMessageFromResponse */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getErrorMessageFromResponseSync", function() { return getErrorMessageFromResponseSync; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getErrorMessageFromResponse", function() { return getErrorMessageFromResponse; });
  function getErrorMessageFromResponseSync(response) {
    return `Failed to fetch resource ${response.url}(${response.status}): ${response.statusText} `;
  }
  
  async function getErrorMessageFromResponse(response) {
    let message = `Failed to fetch resource ${response.url} (${response.status}): `;
    try {
      const contentType = response.headers.get('Content-Type');
      if (contentType.includes('application/json')) {
        message += await response.text();
      } else {
        message += response.statusText;
      }
    } catch (error) {
      // eslint forbids return in finally statement
      return message;
    }
    return message;
  }
  
  
  /***/ }),
  
  /***/ "../core/src/lib/fetch/fetch-file.browser.js":
  /*!***************************************************!*\
    !*** ../core/src/lib/fetch/fetch-file.browser.js ***!
    \***************************************************/
  /*! exports provided: default */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return fetchFileReadable; });
  /* harmony import */ var _loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @loaders.gl/loader-utils */ "../loader-utils/src/index.js");
  /* global FileReader, Headers */
  
  
  // File reader fetch "polyfill" for the browser
  class FileReadableResponse {
    constructor(fileOrBlob, options) {
      this._fileOrBlob = fileOrBlob;
      this.bodyUsed = false;
    }
  
    get headers() {
      return new Headers({
        'Content-Length': this._fileOrBlob.size,
        'Content-Type': this._fileOrBlob.type
      });
    }
  
    get ok() {
      return true; // Blob & File objects are already in memory
    }
  
    get status() {
      return 200; // Blob & File objects are already in memory
    }
  
    get url() {
      // Note: This is just the file name without path information
      // Note: File has `name` field but the Blob baseclass does not
      return this._fileOrBlob.name || '';
    }
  
    async arrayBuffer() {
      const {reader, promise} = this._getFileReader();
      reader.readAsArrayBuffer(this._fileOrBlob);
      return promise;
    }
  
    async text() {
      const {reader, promise} = this._getFileReader();
      reader.readAsText(this._fileOrBlob);
      return promise;
    }
  
    async json() {
      const text = await this.text();
      return JSON.parse(text);
    }
  
    // TODO - body, how to support stream?
    // Can this be portable?
    // eslint-disable-next-line
    // https://developer.mozilla.org/en-US/docs/Web/API/Streams_API/Using_readable_streams#Creating_your_own_custom_readable_stream
    // get body() {
    //   assert(false);
    // }
  
    // PRIVATE
  
    _getFileReader() {
      Object(_loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_0__["assert"])(!this.bodyUsed);
      this.bodyUsed = true;
  
      const reader = new FileReader();
      const promise = new Promise((resolve, reject) => {
        try {
          reader.onerror = _ => reject(new Error('Read error')); // TODO extract error
          reader.onabort = () => reject(new Error('Read aborted.'));
          reader.onload = () => resolve(reader.result);
        } catch (error) {
          reject(error);
        }
      });
      return {reader, promise};
    }
  }
  
  // @param {File|Blob} file  HTML File or Blob object to read as string
  // @returns {Promise.string}  Resolves to a string containing file contents
  function fetchFileReadable(fileOrBlob, options) {
    return Promise.resolve(new FileReadableResponse(fileOrBlob, options));
  }
  
  
  /***/ }),
  
  /***/ "../core/src/lib/fetch/fetch-file.js":
  /*!*******************************************!*\
    !*** ../core/src/lib/fetch/fetch-file.js ***!
    \*******************************************/
  /*! exports provided: fetchFile */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fetchFile", function() { return fetchFile; });
  /* harmony import */ var _loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @loaders.gl/loader-utils */ "../loader-utils/src/index.js");
  /* harmony import */ var _javascript_utils_is_type__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../javascript-utils/is-type */ "../core/src/javascript-utils/is-type.js");
  /* harmony import */ var _fetch_file_browser__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./fetch-file.browser */ "../core/src/lib/fetch/fetch-file.browser.js");
  /* harmony import */ var _fetch_error_message__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./fetch-error-message */ "../core/src/lib/fetch/fetch-error-message.js");
  /* global fetch */
  
  
  
  
  
  // As fetch but respects pathPrefix and file aliases
  // Reads file data from:
  // * data urls
  // * http/http urls
  // * File/Blob objects
  async function fetchFile(url, options = {}) {
    if (Object(_javascript_utils_is_type__WEBPACK_IMPORTED_MODULE_1__["isFileReadable"])(url)) {
      return Object(_fetch_file_browser__WEBPACK_IMPORTED_MODULE_2__["default"])(url, options);
    }
    url = Object(_loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_0__["resolvePath"])(url);
    // TODO - SUPPORT reading from `File` objects
    const response = await fetch(url, options);
    if (!response.ok && options.throws) {
      throw new Error(await Object(_fetch_error_message__WEBPACK_IMPORTED_MODULE_3__["getErrorMessageFromResponse"])(response));
    }
    return response;
  }
  
  
  /***/ }),
  
  /***/ "../core/src/lib/fetch/read-file.browser.js":
  /*!**************************************************!*\
    !*** ../core/src/lib/fetch/read-file.browser.js ***!
    \**************************************************/
  /*! exports provided: readFileSyncBrowser */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "readFileSyncBrowser", function() { return readFileSyncBrowser; });
  /* harmony import */ var _loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @loaders.gl/loader-utils */ "../loader-utils/src/index.js");
  // TODO - this file is not tested
  
  
  const DEFAULT_OPTIONS = {
    dataType: 'arraybuffer',
    // TODO - this was mostly set to true to make test cases work
    nothrow: true
  };
  
  const isDataURL = url => url.startsWith('data:');
  
  // In a few cases (data URIs, files under Node) "files" can be read synchronously
  function readFileSyncBrowser(uri, options) {
    options = getReadFileOptions(options);
  
    if (isDataURL(uri)) {
      // TODO - removed until decodeDataUri does not depend on Node.js Buffer
      //   return decodeDataUri(uri);
    }
  
    if (!options.nothrow) {
      // throw new Error('Cant load URI synchronously');
      Object(_loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_0__["assert"])(false);
    }
  
    return null;
  }
  
  // HELPER FUNCTIONS
  
  function getReadFileOptions(options = {}) {
    options = Object.assign({}, DEFAULT_OPTIONS, options);
    options.responseType = options.responseType || options.dataType;
    return options;
  }
  
  
  /***/ }),
  
  /***/ "../core/src/lib/fetch/read-file.js":
  /*!******************************************!*\
    !*** ../core/src/lib/fetch/read-file.js ***!
    \******************************************/
  /*! exports provided: readFileSync */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "readFileSync", function() { return readFileSync; });
  /* harmony import */ var _loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @loaders.gl/loader-utils */ "../loader-utils/src/index.js");
  /* harmony import */ var _node_read_file_sync_node__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../node/read-file-sync.node */ 1);
  /* harmony import */ var _node_read_file_sync_node__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_read_file_sync_node__WEBPACK_IMPORTED_MODULE_1__);
  /* harmony import */ var _read_file_browser__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./read-file.browser */ "../core/src/lib/fetch/read-file.browser.js");
  
  
  
  
  // In a few cases (data URIs, node.js) "files" can be read synchronously
  function readFileSync(url, options = {}) {
    url = Object(_loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_0__["resolvePath"])(url);
    if (!_loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_0__["isBrowser"] && _node_read_file_sync_node__WEBPACK_IMPORTED_MODULE_1__["readFileSync"]) {
      return _node_read_file_sync_node__WEBPACK_IMPORTED_MODULE_1__["readFileSync"](url, options);
    }
    return Object(_read_file_browser__WEBPACK_IMPORTED_MODULE_2__["readFileSyncBrowser"])(url, options);
  }
  
  
  /***/ }),
  
  /***/ "../core/src/lib/fetch/write-file.js":
  /*!*******************************************!*\
    !*** ../core/src/lib/fetch/write-file.js ***!
    \*******************************************/
  /*! exports provided: writeFile, writeFileSync */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "writeFile", function() { return writeFile; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "writeFileSync", function() { return writeFileSync; });
  /* harmony import */ var _loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @loaders.gl/loader-utils */ "../loader-utils/src/index.js");
  /* harmony import */ var _node_write_file_node__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../node/write-file.node */ 2);
  /* harmony import */ var _node_write_file_node__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_write_file_node__WEBPACK_IMPORTED_MODULE_1__);
  
  
  
  function writeFile(filePath, arrayBufferOrString, options) {
    filePath = Object(_loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_0__["resolvePath"])(filePath);
    if (!_loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_0__["isBrowser"] && _node_write_file_node__WEBPACK_IMPORTED_MODULE_1__["writeFile"]) {
      return _node_write_file_node__WEBPACK_IMPORTED_MODULE_1__["writeFile"](filePath, arrayBufferOrString, options);
    }
    return Object(_loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_0__["assert"])(false);
  }
  
  function writeFileSync(filePath, arrayBufferOrString, options) {
    filePath = Object(_loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_0__["resolvePath"])(filePath);
    if (!_loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_0__["isBrowser"] && _node_write_file_node__WEBPACK_IMPORTED_MODULE_1__["writeFileSync"]) {
      return _node_write_file_node__WEBPACK_IMPORTED_MODULE_1__["writeFileSync"](filePath, arrayBufferOrString, options);
    }
    return Object(_loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_0__["assert"])(false);
  }
  
  
  /***/ }),
  
  /***/ "../core/src/lib/load-in-batches.js":
  /*!******************************************!*\
    !*** ../core/src/lib/load-in-batches.js ***!
    \******************************************/
  /*! exports provided: loadInBatches */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "loadInBatches", function() { return loadInBatches; });
  /* harmony import */ var _fetch_fetch_file__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./fetch/fetch-file */ "../core/src/lib/fetch/fetch-file.js");
  /* harmony import */ var _parse_in_batches__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./parse-in-batches */ "../core/src/lib/parse-in-batches.js");
  
  
  
  async function loadInBatches(url, loaders, options) {
    const response = await Object(_fetch_fetch_file__WEBPACK_IMPORTED_MODULE_0__["fetchFile"])(url, options);
    return Object(_parse_in_batches__WEBPACK_IMPORTED_MODULE_1__["parseInBatches"])(response, loaders, options, url);
  }
  
  
  /***/ }),
  
  /***/ "../core/src/lib/load.js":
  /*!*******************************!*\
    !*** ../core/src/lib/load.js ***!
    \*******************************/
  /*! exports provided: load */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "load", function() { return load; });
  /* harmony import */ var _javascript_utils_is_type__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../javascript-utils/is-type */ "../core/src/javascript-utils/is-type.js");
  /* harmony import */ var _fetch_fetch_file__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./fetch/fetch-file */ "../core/src/lib/fetch/fetch-file.js");
  /* harmony import */ var _loader_utils_normalize_loader__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./loader-utils/normalize-loader */ "../core/src/lib/loader-utils/normalize-loader.js");
  /* harmony import */ var _parse__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./parse */ "../core/src/lib/parse.js");
  
  
  
  
  
  
  // Note: Load does duplicate a lot of parse.
  // it can also call fetchFile on string urls, which `parse` won't do.
  async function load(url, loaders, options) {
    // Signature: load(url, options)
    if (!Array.isArray(loaders) && !Object(_loader_utils_normalize_loader__WEBPACK_IMPORTED_MODULE_2__["isLoaderObject"])(loaders)) {
      options = loaders;
      loaders = null;
    }
  
    // at this point, `url` could be already loaded binary data
    let data = url;
  
    // url is a string, fetch the url
    if (typeof url === 'string') {
      data = await Object(_fetch_fetch_file__WEBPACK_IMPORTED_MODULE_1__["fetchFile"])(url, options);
    } else {
      url = null;
    }
  
    // URL is Blob or File, fetchFile handles it (alt: we could generate ObjectURL here)
    if (Object(_javascript_utils_is_type__WEBPACK_IMPORTED_MODULE_0__["isFileReadable"])(url)) {
      // The fetch response object will contain blob.name
      data = await Object(_fetch_fetch_file__WEBPACK_IMPORTED_MODULE_1__["fetchFile"])(url, options);
      url = null;
    }
  
    // Data is loaded (at least we have a `Response` object) so time to hand over to `parse`
    return await Object(_parse__WEBPACK_IMPORTED_MODULE_3__["parse"])(data, loaders, options, url);
  }
  
  
  /***/ }),
  
  /***/ "../core/src/lib/loader-utils/check-errors.js":
  /*!****************************************************!*\
    !*** ../core/src/lib/loader-utils/check-errors.js ***!
    \****************************************************/
  /*! exports provided: checkFetchResponseStatus, checkFetchResponseStatusSync */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "checkFetchResponseStatus", function() { return checkFetchResponseStatus; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "checkFetchResponseStatusSync", function() { return checkFetchResponseStatusSync; });
  async function checkFetchResponseStatus(response) {
    if (!response.ok) {
      let errorMessage = `fetch failed ${response.status} `;
      try {
        const text = await response.text();
        errorMessage += text;
      } catch (error) {
        // ignore error
      }
      throw new Error(errorMessage);
    }
  }
  
  function checkFetchResponseStatusSync(response) {
    if (!response.ok) {
      throw new Error(`fetch failed ${response.status}`);
    }
  }
  
  
  /***/ }),
  
  /***/ "../core/src/lib/loader-utils/get-data.js":
  /*!************************************************!*\
    !*** ../core/src/lib/loader-utils/get-data.js ***!
    \************************************************/
  /*! exports provided: getUrlFromData, getArrayBufferOrStringFromDataSync, getArrayBufferOrStringFromData, getAsyncIteratorFromData, getIteratorFromData */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getUrlFromData", function() { return getUrlFromData; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getArrayBufferOrStringFromDataSync", function() { return getArrayBufferOrStringFromDataSync; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getArrayBufferOrStringFromData", function() { return getArrayBufferOrStringFromData; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getAsyncIteratorFromData", function() { return getAsyncIteratorFromData; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getIteratorFromData", function() { return getIteratorFromData; });
  /* harmony import */ var _javascript_utils_is_type__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../javascript-utils/is-type */ "../core/src/javascript-utils/is-type.js");
  /* harmony import */ var _iterator_utils_stream_iteration__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../iterator-utils/stream-iteration */ "../core/src/iterator-utils/stream-iteration.js");
  /* harmony import */ var _iterator_utils_chunk_iteration__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../iterator-utils/chunk-iteration */ "../core/src/iterator-utils/chunk-iteration.js");
  /* harmony import */ var _fetch_fetch_file_browser__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../fetch/fetch-file.browser */ "../core/src/lib/fetch/fetch-file.browser.js");
  /* harmony import */ var _check_errors__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./check-errors */ "../core/src/lib/loader-utils/check-errors.js");
  /* global TextDecoder */
  
  
  
  
  
  
  const ERR_DATA = 'Cannot convert supplied data type';
  
  // Extract a URL from `parse` arguments if possible
  // If a fetch Response object or File/Blob were passed in get URL from those objects
  function getUrlFromData(data, url) {
    if (Object(_javascript_utils_is_type__WEBPACK_IMPORTED_MODULE_0__["isFetchResponse"])(data)) {
      url = url || data.url;
    } else if (Object(_javascript_utils_is_type__WEBPACK_IMPORTED_MODULE_0__["isFileReadable"])(url)) {
      // File or Blob
      url = url.name;
    }
    // Strip any query string
    return typeof url === 'string' ? url.replace(/\?.*/, '') : url;
  }
  
  // eslint-disable-next-line complexity
  function getArrayBufferOrStringFromDataSync(data, loader) {
    if (loader.text && typeof data === 'string') {
      return data;
    }
  
    if (data instanceof ArrayBuffer) {
      const arrayBuffer = data;
      if (loader.text && !loader.binary) {
        const textDecoder = new TextDecoder('utf8');
        return textDecoder.decode(arrayBuffer);
      }
      return arrayBuffer;
    }
  
    // We may need to handle offsets
    if (ArrayBuffer.isView(data) || Object(_javascript_utils_is_type__WEBPACK_IMPORTED_MODULE_0__["isBuffer"])(data)) {
      // TextDecoder is invoked on typed arrays and will handle offsets
      if (loader.text && !loader.binary) {
        const textDecoder = new TextDecoder('utf8');
        return textDecoder.decode(data);
      }
  
      let arrayBuffer = data.buffer;
  
      // Since we are returning the underlying arrayBuffer, we must create a new copy
      // if this typed array / Buffer is a partial view into the ArryayBuffer
      // TODO - this is a potentially unnecessary copy
      const byteLength = data.byteLength || data.length;
      if (data.byteOffset !== 0 || byteLength !== arrayBuffer.byteLength) {
        // console.warn(`loaders.gl copying arraybuffer of length ${byteLength}`);
        arrayBuffer = arrayBuffer.slice(data.byteOffset, data.byteOffset + byteLength);
      }
      return arrayBuffer;
    }
  
    throw new Error(ERR_DATA);
  }
  
  // Convert async iterator to a promise
  async function getArrayBufferOrStringFromData(data, loader) {
    // Resolve any promise
    data = await data;
  
    const isArrayBuffer = data instanceof ArrayBuffer || ArrayBuffer.isView(data);
    if (typeof data === 'string' || isArrayBuffer) {
      return getArrayBufferOrStringFromDataSync(data, loader);
    }
  
    // Blobs and files are FileReader compatible
    if (Object(_javascript_utils_is_type__WEBPACK_IMPORTED_MODULE_0__["isFileReadable"])(data)) {
      data = await Object(_fetch_fetch_file_browser__WEBPACK_IMPORTED_MODULE_3__["default"])(data);
    }
  
    if (Object(_javascript_utils_is_type__WEBPACK_IMPORTED_MODULE_0__["isFetchResponse"])(data)) {
      const response = data;
      await Object(_check_errors__WEBPACK_IMPORTED_MODULE_4__["checkFetchResponseStatus"])(response);
      return loader.binary ? await response.arrayBuffer() : await response.text();
    }
  
    if (Object(_javascript_utils_is_type__WEBPACK_IMPORTED_MODULE_0__["isReadableStream"])(data)) {
      data = Object(_iterator_utils_stream_iteration__WEBPACK_IMPORTED_MODULE_1__["makeStreamIterator"])(data);
    }
  
    if (Object(_javascript_utils_is_type__WEBPACK_IMPORTED_MODULE_0__["isIterable"])(data) || Object(_javascript_utils_is_type__WEBPACK_IMPORTED_MODULE_0__["isAsyncIterable"])(data)) {
      // Assume arrayBuffer iterator - attempt to concatenate
      return Object(_iterator_utils_chunk_iteration__WEBPACK_IMPORTED_MODULE_2__["concatenateChunksAsync"])(data);
    }
  
    throw new Error(ERR_DATA);
  }
  
  function getAsyncIteratorFromData(data) {
    if (Object(_javascript_utils_is_type__WEBPACK_IMPORTED_MODULE_0__["isIterator"])(data)) {
      return data;
    }
  
    // TODO: Our fetchFileReaderObject response does not yet support a body stream
    if (Object(_javascript_utils_is_type__WEBPACK_IMPORTED_MODULE_0__["isFetchResponse"])(data) && data.body) {
      // Note Since this function is not async, we currently can't load error message, just status
      Object(_check_errors__WEBPACK_IMPORTED_MODULE_4__["checkFetchResponseStatusSync"])(data);
      return Object(_iterator_utils_stream_iteration__WEBPACK_IMPORTED_MODULE_1__["makeStreamIterator"])(data.body);
    }
  
    if (Object(_javascript_utils_is_type__WEBPACK_IMPORTED_MODULE_0__["isReadableStream"])(data)) {
      return Object(_iterator_utils_stream_iteration__WEBPACK_IMPORTED_MODULE_1__["makeStreamIterator"])(data);
    }
  
    if (Object(_javascript_utils_is_type__WEBPACK_IMPORTED_MODULE_0__["isAsyncIterable"])(data)) {
      return data[Symbol.asyncIterator]();
    }
  
    return getIteratorFromData(data);
  }
  
  function getIteratorFromData(data) {
    // generate an iterator that emits a single chunk
    if (data instanceof ArrayBuffer || ArrayBuffer.isView(data)) {
      return (function* oneChunk() {
        yield data.buffer || data;
      })();
    }
  
    if (Object(_javascript_utils_is_type__WEBPACK_IMPORTED_MODULE_0__["isIterator"])(data)) {
      return data;
    }
  
    if (Object(_javascript_utils_is_type__WEBPACK_IMPORTED_MODULE_0__["isIterable"])(data)) {
      return data[Symbol.iterator]();
    }
  
    throw new Error(ERR_DATA);
  }
  
  
  /***/ }),
  
  /***/ "../core/src/lib/loader-utils/get-loader-context.js":
  /*!**********************************************************!*\
    !*** ../core/src/lib/loader-utils/get-loader-context.js ***!
    \**********************************************************/
  /*! exports provided: getLoaderContext, getLoaders */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLoaderContext", function() { return getLoaderContext; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLoaders", function() { return getLoaders; });
  /* harmony import */ var _fetch_fetch_file__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../fetch/fetch-file */ "../core/src/lib/fetch/fetch-file.js");
  // "sub" loaders invoked by other loaders get a "context" injected on `this`
  // The context will inject core methods like `parse` and contain information
  // about loaders and options passed in to the top-level `parse` call.
  
  
  function getLoaderContext(context, options, previousContext) {
    // For recursive calls, we already have a context
    // TODO - add any additional loaders to context?
    if (previousContext) {
      return previousContext;
    }
    context = {
      // TODO - determine how to inject fetch, fetch in options etc
      fetch: context.fetch || _fetch_fetch_file__WEBPACK_IMPORTED_MODULE_0__["fetchFile"],
      ...context
    };
  
    // Recursive loading does not use single loader
    if (!Array.isArray(context.loaders)) {
      context.loaders = null;
    }
  
    return context;
  }
  
  function getLoaders(loaders, context) {
    // A single non-array loader is force selected, but only on top-level (context === null)
    if (!context && !Array.isArray(loaders)) {
      return loaders;
    }
  
    // Create a merged list
    let candidateLoaders;
    if (loaders) {
      candidateLoaders = Array.isArray(loaders) ? loaders : [loaders];
    }
    if (context && context.loaders) {
      const contextLoaders = Array.isArray(context.loaders) ? context.loaders : [context.loaders];
      candidateLoaders = candidateLoaders ? [...candidateLoaders, ...contextLoaders] : contextLoaders;
    }
    // If no loaders, return null to look in globally registered loaders
    return candidateLoaders && candidateLoaders.length ? candidateLoaders : null;
  }
  
  
  /***/ }),
  
  /***/ "../core/src/lib/loader-utils/loggers.js":
  /*!***********************************************!*\
    !*** ../core/src/lib/loader-utils/loggers.js ***!
    \***********************************************/
  /*! exports provided: NullLog, ConsoleLog */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NullLog", function() { return NullLog; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ConsoleLog", function() { return ConsoleLog; });
  // probe.gl Log compatible loggers
  
  // Logs nothing
  class NullLog {
    log() {
      return _ => {};
    }
    info() {
      return _ => {};
    }
    warn() {
      return _ => {};
    }
    error() {
      return _ => {};
    }
  }
  
  // Logs to console
  class ConsoleLog {
    constructor() {
      this.console = console; // eslint-disable-line
    }
    log(...args) {
      return this.console.log.bind(this.console, ...args);
    }
    info(...args) {
      return this.console.info.bind(this.console, ...args);
    }
    warn(...args) {
      return this.console.warn.bind(this.console, ...args);
    }
    error(...args) {
      return this.console.error.bind(this.console, ...args);
    }
  }
  
  
  /***/ }),
  
  /***/ "../core/src/lib/loader-utils/merge-options.js":
  /*!*****************************************************!*\
    !*** ../core/src/lib/loader-utils/merge-options.js ***!
    \*****************************************************/
  /*! exports provided: setGlobalOptions, mergeOptions */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setGlobalOptions", function() { return setGlobalOptions; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mergeOptions", function() { return mergeOptions; });
  /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constants */ "../core/src/lib/constants.js");
  /* harmony import */ var _loggers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./loggers */ "../core/src/lib/loader-utils/loggers.js");
  
  
  
  const isPureObject = value =>
    value && typeof value === 'object' && value.constructor === {}.constructor;
  
  let globalOptions = {..._constants__WEBPACK_IMPORTED_MODULE_0__["DEFAULT_LOADER_OPTIONS"]};
  
  // Set global loader options
  function setGlobalOptions(options) {
    globalOptions = mergeOptions(globalOptions, options);
  }
  
  // Merges options with global opts and loader defaults, also injects baseUri
  function mergeOptions(loader, options, url) {
    const loaderDefaultOptions =
      loader && (loader.DEFAULT_LOADER_OPTIONS || loader.defaultOptions || loader.options || {});
  
    const mergedOptions = {...loaderDefaultOptions};
  
    addUrlOptions(mergedOptions, url);
  
    // LOGGING: options.log can be set to `null` to defeat logging
    if (mergedOptions.log === null) {
      mergedOptions.log = new _loggers__WEBPACK_IMPORTED_MODULE_1__["NullLog"]();
    }
  
    mergeNestedFields(mergedOptions, globalOptions);
    mergeNestedFields(mergedOptions, options);
  
    return mergedOptions;
  }
  
  // Merge nested options objects
  function mergeNestedFields(mergedOptions, options) {
    for (const key in options) {
      // Check for nested options
      // object in options => either no key in defaultOptions or object in defaultOptions
      if (key in options) {
        const value = options[key];
        if (isPureObject(value) && isPureObject(mergedOptions[key])) {
          mergedOptions[key] = {
            ...mergedOptions[key],
            ...options[key]
          };
        } else {
          mergedOptions[key] = options[key];
        }
      }
      // else: No need to merge nested opts, and the initial merge already copied over the nested options
    }
  }
  
  // Harvest information from the url
  // TODO - baseUri should be a directory, i.e. remove file component from baseUri
  // TODO - extract extension?
  // TODO - extract query parameters?
  // TODO - should these be injected on context instead of options?
  function addUrlOptions(options, url) {
    if (url && !('baseUri' in options)) {
      options.baseUri = url;
    }
  }
  
  
  /***/ }),
  
  /***/ "../core/src/lib/loader-utils/normalize-loader.js":
  /*!********************************************************!*\
    !*** ../core/src/lib/loader-utils/normalize-loader.js ***!
    \********************************************************/
  /*! exports provided: isLoaderObject, normalizeLoader */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isLoaderObject", function() { return isLoaderObject; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalizeLoader", function() { return normalizeLoader; });
  /* harmony import */ var _loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @loaders.gl/loader-utils */ "../loader-utils/src/index.js");
  
  
  function isLoaderObject(loader) {
    if (!loader) {
      return false;
    }
  
    if (Array.isArray(loader)) {
      loader = loader[0];
    }
  
    let hasParser =
      loader.parseTextSync ||
      loader.parseSync ||
      loader.parse ||
      loader.parseStream || // TODO Remove, Replace with parseInBatches
      loader.parseInBatches;
  
    const loaderOptions = loader.options && loader.options[loader.id];
    hasParser = hasParser || (loaderOptions && loaderOptions.workerUrl);
  
    return hasParser;
  }
  
  function normalizeLoader(loader) {
    // This error is fairly easy to trigger by mixing up import statments etc
    // So we make an exception and add a developer error message for this case
    // To help new users from getting stuck here
    Object(_loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_0__["assert"])(loader, 'null loader');
    Object(_loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_0__["assert"])(isLoaderObject(loader), 'invalid loader');
  
    // NORMALIZE [LOADER, OPTIONS] => LOADER
  
    // If [loader, options], create a new loaders object with options merged in
    let options;
    if (Array.isArray(loader)) {
      options = loader[1];
      loader = loader[0];
      loader = {
        ...loader,
        options: {...loader.options, ...options}
      };
    }
  
    // NORMALIZE LOADER.EXTENSIONS
  
    // Remove `extension`` prop, replace with `extensions``
    if (loader.extension) {
      loader.extensions = loader.extensions || loader.extension;
      delete loader.extension;
    }
  
    // Ensure loader.extensions is an array
    if (!Array.isArray(loader.extensions)) {
      loader.extensions = [loader.extensions];
    }
  
    Object(_loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_0__["assert"])(loader.extensions && loader.extensions.length > 0 && loader.extensions[0]);
  
    // NORMALIZE text and binary flags
  
    // Ensure at least one of text/binary flags are properly set
    if (loader.parseTextSync) {
      loader.text = true;
    }
  
    if (!loader.text) {
      loader.binary = true;
    }
  
    // TODO - Does adding a default MIME type add any value?
    /*
    if (!loader.mimeType) {
      if (loader.binary) {
        // TODO - do we need separate mime types for binary and text formats?
        loader.mimeType = 'application/octet-stream';
      }
    }
    */
  
    return loader;
  }
  
  
  /***/ }),
  
  /***/ "../core/src/lib/loader-utils/parse-with-worker.js":
  /*!*********************************************************!*\
    !*** ../core/src/lib/loader-utils/parse-with-worker.js ***!
    \*********************************************************/
  /*! exports provided: canParseWithWorker, default */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "canParseWithWorker", function() { return canParseWithWorker; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return parseWithWorker; });
  /* harmony import */ var _javascript_utils_binary_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../javascript-utils/binary-utils */ "../core/src/javascript-utils/binary-utils.js");
  /* harmony import */ var _worker_utils_worker_farm__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../worker-utils/worker-farm */ "../core/src/worker-utils/worker-farm.js");
  /* harmony import */ var _loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @loaders.gl/loader-utils */ "../loader-utils/src/index.js");
  /* harmony import */ var _parse__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../parse */ "../core/src/lib/parse.js");
  // __VERSION__ is injected by babel-plugin-version-inline
  /* global __VERSION__ */
  
  
  
  
  
  // @ts-ignore TS2304: Cannot find name '__VERSION__'.
  const VERSION =  true ? "2.1.6" : undefined;
  
  function canParseWithWorker(loader, data, options, context) {
    if (!_worker_utils_worker_farm__WEBPACK_IMPORTED_MODULE_1__["default"].isSupported()) {
      return false;
    }
    const loaderOptions = options && options[loader.id];
    if (
      (options.worker === 'local' && loaderOptions && loaderOptions.localWorkerUrl) ||
      (options.worker && loaderOptions && loaderOptions.workerUrl)
    ) {
      return loader.useWorker ? loader.useWorker(options) : true;
    }
    return false;
  }
  
  /**
   * this function expects that the worker function sends certain messages,
   * this can be automated if the worker is wrapper by a call to createWorker in @loaders.gl/loader-utils.
   */
  function parseWithWorker(loader, data, options, context) {
    const {worker} = options || {};
    const loaderOptions = (options && options[loader.id]) || {};
    const workerUrl = worker === 'local' ? loaderOptions.localWorkerUrl : loaderOptions.workerUrl;
  
    // Mark as URL
    const workerSource = `url(${workerUrl})`;
    const workerName = loader.name;
  
    const workerFarm = getWorkerFarm(options);
  
    // options.log object contains functions which cannot be transferred
    // TODO - decide how to handle logging on workers
    options = JSON.parse(JSON.stringify(options));
  
    const warning = loader.version !== VERSION ? `(core version ${VERSION})` : '';
  
    return workerFarm.process(workerSource, `${workerName}-worker@${loader.version}${warning}`, {
      arraybuffer: Object(_javascript_utils_binary_utils__WEBPACK_IMPORTED_MODULE_0__["toArrayBuffer"])(data),
      options,
      source: `loaders.gl@${VERSION}`, // Lets worker ignore unrelated messages
      type: 'parse' // For future extension
    });
  }
  
  let _workerFarm = null;
  
  // Create a single instance of a worker farm
  function getWorkerFarm(options = {}) {
    const props = {};
    if (options.maxConcurrency) {
      props.maxConcurrency = options.maxConcurrency;
    }
    if (options.onDebug) {
      props.onDebug = options.onDebug;
    }
  
    if (!_workerFarm) {
      _workerFarm = new _worker_utils_worker_farm__WEBPACK_IMPORTED_MODULE_1__["default"]({onMessage: onWorkerMessage});
    }
    _workerFarm.setProps(props);
  
    return _workerFarm;
  }
  
  async function onWorkerMessage({worker, data, resolve, reject}) {
    switch (data.type) {
      case 'done':
        resolve(data.result);
        break;
  
      case 'parse':
        try {
          const result = await Object(_parse__WEBPACK_IMPORTED_MODULE_3__["parse"])(data.arraybuffer, data.options, data.url);
          worker.postMessage({type: 'parse-done', id: data.id, result}, Object(_loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_2__["getTransferList"])(result));
        } catch (error) {
          worker.postMessage({type: 'parse-error', id: data.id, message: error.message});
        }
        break;
  
      case 'error':
        reject(data.message);
        break;
  
      default:
      // TODO - is this not an error case? Log a warning?
    }
  }
  
  
  /***/ }),
  
  /***/ "../core/src/lib/parse-in-batches-sync.js":
  /*!************************************************!*\
    !*** ../core/src/lib/parse-in-batches-sync.js ***!
    \************************************************/
  /*! exports provided: parseInBatchesSync */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseInBatchesSync", function() { return parseInBatchesSync; });
  /* harmony import */ var _loader_utils_normalize_loader__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./loader-utils/normalize-loader */ "../core/src/lib/loader-utils/normalize-loader.js");
  /* harmony import */ var _loader_utils_merge_options__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./loader-utils/merge-options */ "../core/src/lib/loader-utils/merge-options.js");
  /* harmony import */ var _loader_utils_get_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./loader-utils/get-data */ "../core/src/lib/loader-utils/get-data.js");
  /* harmony import */ var _loader_utils_get_loader_context__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./loader-utils/get-loader-context */ "../core/src/lib/loader-utils/get-loader-context.js");
  /* harmony import */ var _select_loader__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./select-loader */ "../core/src/lib/select-loader.js");
  
  
  
  
  
  
  // TODO - remove?
  async function parseInBatchesSync(data, loaders, options, url) {
    // Signature: parseInBatchesSync(data, options, url)
    // Uses registered loaders
    if (!Array.isArray(loaders) && !Object(_loader_utils_normalize_loader__WEBPACK_IMPORTED_MODULE_0__["isLoaderObject"])(loaders)) {
      url = options;
      options = loaders;
      loaders = null;
    }
  
    // Chooses a loader and normalizes it
    // TODO - only uses URL, need a selectLoader variant that peeks at first stream chunk...
    const loader = Object(_select_loader__WEBPACK_IMPORTED_MODULE_4__["selectLoader"])(loaders, url, null);
  
    // Normalize options
    options = Object(_loader_utils_merge_options__WEBPACK_IMPORTED_MODULE_1__["mergeOptions"])(loader, options);
  
    const context = Object(_loader_utils_get_loader_context__WEBPACK_IMPORTED_MODULE_3__["getLoaderContext"])({url, loaders}, options);
  
    return parseWithLoaderInBatchesSync(loader, data, options, context);
  }
  
  function parseWithLoaderInBatchesSync(loader, data, options, context) {
    // Create async iterator adapter for data, and concatenate result
    if (loader.parseInBatchesSync) {
      const inputIterator = Object(_loader_utils_get_data__WEBPACK_IMPORTED_MODULE_2__["getIteratorFromData"])(data);
      const outputIterator = loader.parseInBatchesSync(inputIterator, options, context, loader);
      return outputIterator;
    }
  
    throw new Error('parseWithLoaderInBatchesSync not available');
  }
  
  
  /***/ }),
  
  /***/ "../core/src/lib/parse-in-batches.js":
  /*!*******************************************!*\
    !*** ../core/src/lib/parse-in-batches.js ***!
    \*******************************************/
  /*! exports provided: parseInBatches */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseInBatches", function() { return parseInBatches; });
  /* harmony import */ var _loader_utils_normalize_loader__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./loader-utils/normalize-loader */ "../core/src/lib/loader-utils/normalize-loader.js");
  /* harmony import */ var _loader_utils_merge_options__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./loader-utils/merge-options */ "../core/src/lib/loader-utils/merge-options.js");
  /* harmony import */ var _loader_utils_get_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./loader-utils/get-data */ "../core/src/lib/loader-utils/get-data.js");
  /* harmony import */ var _loader_utils_get_loader_context__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./loader-utils/get-loader-context */ "../core/src/lib/loader-utils/get-loader-context.js");
  /* harmony import */ var _select_loader__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./select-loader */ "../core/src/lib/select-loader.js");
  /* harmony import */ var _iterator_utils_async_iteration__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../iterator-utils/async-iteration */ "../core/src/iterator-utils/async-iteration.js");
  
  
  
  
  
  
  
  async function parseInBatches(data, loaders, options, url) {
    // Signature: parseInBatches(data, options, url)
    // Uses registered loaders
    if (!Array.isArray(loaders) && !Object(_loader_utils_normalize_loader__WEBPACK_IMPORTED_MODULE_0__["isLoaderObject"])(loaders)) {
      url = options;
      options = loaders;
      loaders = null;
    }
  
    // Chooses a loader and normalizes it
    // TODO - only uses URL, need a selectLoader variant that peeks at first stream chunk...
    const loader = Object(_select_loader__WEBPACK_IMPORTED_MODULE_4__["selectLoader"])(loaders, url, null);
  
    // Normalize options
    options = Object(_loader_utils_merge_options__WEBPACK_IMPORTED_MODULE_1__["mergeOptions"])(loader, options, url);
  
    const context = Object(_loader_utils_get_loader_context__WEBPACK_IMPORTED_MODULE_3__["getLoaderContext"])({url, loaders}, options);
  
    return parseWithLoaderInBatches(loader, data, options, context);
  }
  
  function parseWithLoaderInBatches(loader, data, options, context) {
    // Create async iterator adapter for data, and concatenate result
    if (loader.parseInBatches) {
      let inputIterator = Object(_loader_utils_get_data__WEBPACK_IMPORTED_MODULE_2__["getAsyncIteratorFromData"])(data);
      // Converts ArrayBuffer chunks to text chunks (leaves text chunks alone)
      if (loader.text) {
        inputIterator = Object(_iterator_utils_async_iteration__WEBPACK_IMPORTED_MODULE_5__["textDecoderAsyncIterator"])(inputIterator);
      }
      const outputIterator = loader.parseInBatches(inputIterator, options, context, loader);
      return outputIterator;
    }
  
    throw new Error('parseWithLoaderInBatchesSync not available');
  }
  
  
  /***/ }),
  
  /***/ "../core/src/lib/parse-sync.js":
  /*!*************************************!*\
    !*** ../core/src/lib/parse-sync.js ***!
    \*************************************/
  /*! exports provided: parseSync */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseSync", function() { return parseSync; });
  /* harmony import */ var _select_loader__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./select-loader */ "../core/src/lib/select-loader.js");
  /* harmony import */ var _loader_utils_normalize_loader__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./loader-utils/normalize-loader */ "../core/src/lib/loader-utils/normalize-loader.js");
  /* harmony import */ var _loader_utils_merge_options__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./loader-utils/merge-options */ "../core/src/lib/loader-utils/merge-options.js");
  /* harmony import */ var _loader_utils_get_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./loader-utils/get-data */ "../core/src/lib/loader-utils/get-data.js");
  /* harmony import */ var _loader_utils_get_loader_context__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./loader-utils/get-loader-context */ "../core/src/lib/loader-utils/get-loader-context.js");
  
  
  
  
  
  
  function parseSync(data, loaders, options, context) {
    // Signature: parseSync(data, options, url)
    // Uses registered loaders
    if (!Array.isArray(loaders) && !Object(_loader_utils_normalize_loader__WEBPACK_IMPORTED_MODULE_1__["isLoaderObject"])(loaders)) {
      context = options;
      options = loaders;
      loaders = null;
    }
  
    // DEPRECATED - backwards compatibility, last param can be URL...
    let url = '';
    if (typeof context === 'string') {
      url = context;
      context = null;
    }
  
    options = options || {};
  
    // Chooses a loader (and normalizes it)
    // Also use any loaders in the context, new loaders take priority
    const candidateLoaders = Object(_loader_utils_get_loader_context__WEBPACK_IMPORTED_MODULE_4__["getLoaders"])(loaders, context);
    const loader = Object(_select_loader__WEBPACK_IMPORTED_MODULE_0__["selectLoader"])(candidateLoaders, url, data);
    // Note: if nothrow option was set, it is possible that no loader was found, if so just return null
    if (!loader) {
      return null;
    }
  
    // Normalize options
    options = Object(_loader_utils_merge_options__WEBPACK_IMPORTED_MODULE_2__["mergeOptions"])(loader, options, url);
  
    context = Object(_loader_utils_get_loader_context__WEBPACK_IMPORTED_MODULE_4__["getLoaderContext"])({url, parseSync, loaders}, options);
  
    return parseWithLoaderSync(loader, data, options, context);
  }
  
  // TODO - should accept loader.parseSync/parse and generate 1 chunk asyncIterator
  function parseWithLoaderSync(loader, data, options, context) {
    data = Object(_loader_utils_get_data__WEBPACK_IMPORTED_MODULE_3__["getArrayBufferOrStringFromDataSync"])(data, loader);
  
    if (loader.parseTextSync && typeof data === 'string') {
      return loader.parseTextSync(data, options, context, loader);
    }
  
    if (loader.parseSync) {
      return loader.parseSync(data, options, context, loader);
    }
  
    // TBD - If synchronous parser not available, return null
    throw new Error(
      `${
        loader.name
      } loader: 'parseSync' not supported by this loader, use 'parse' instead. ${context.url || ''}`
    );
  }
  
  
  /***/ }),
  
  /***/ "../core/src/lib/parse.js":
  /*!********************************!*\
    !*** ../core/src/lib/parse.js ***!
    \********************************/
  /*! exports provided: parse */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parse", function() { return parse; });
  /* harmony import */ var _loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @loaders.gl/loader-utils */ "../loader-utils/src/index.js");
  /* harmony import */ var _loader_utils_normalize_loader__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./loader-utils/normalize-loader */ "../core/src/lib/loader-utils/normalize-loader.js");
  /* harmony import */ var _loader_utils_merge_options__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./loader-utils/merge-options */ "../core/src/lib/loader-utils/merge-options.js");
  /* harmony import */ var _loader_utils_get_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./loader-utils/get-data */ "../core/src/lib/loader-utils/get-data.js");
  /* harmony import */ var _loader_utils_get_loader_context__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./loader-utils/get-loader-context */ "../core/src/lib/loader-utils/get-loader-context.js");
  /* harmony import */ var _loader_utils_parse_with_worker__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./loader-utils/parse-with-worker */ "../core/src/lib/loader-utils/parse-with-worker.js");
  /* harmony import */ var _select_loader__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./select-loader */ "../core/src/lib/select-loader.js");
  
  
  
  
  
  
  
  
  
  async function parse(data, loaders, options, context) {
    // Signature: parse(data, options, context | url)
    // Uses registered loaders
    if (loaders && !Array.isArray(loaders) && !Object(_loader_utils_normalize_loader__WEBPACK_IMPORTED_MODULE_1__["isLoaderObject"])(loaders)) {
      context = options;
      options = loaders;
      loaders = null;
    }
  
    // DEPRECATED - backwards compatibility, last param can be URL...
    let url = '';
    if (typeof context === 'string') {
      url = context;
      context = null;
    }
  
    options = options || {};
  
    // Extract a url for auto detection
    const autoUrl = Object(_loader_utils_get_data__WEBPACK_IMPORTED_MODULE_3__["getUrlFromData"])(data, url);
  
    // Chooses a loader (and normalizes it)
    // Also use any loaders in the context, new loaders take priority
    const candidateLoaders = Object(_loader_utils_get_loader_context__WEBPACK_IMPORTED_MODULE_4__["getLoaders"])(loaders, context);
    const loader = Object(_select_loader__WEBPACK_IMPORTED_MODULE_6__["selectLoader"])(candidateLoaders, autoUrl, data);
    // Note: if nothrow option was set, it is possible that no loader was found, if so just return null
    if (!loader) {
      return null;
    }
  
    // Normalize options
    options = Object(_loader_utils_merge_options__WEBPACK_IMPORTED_MODULE_2__["mergeOptions"])(loader, options, autoUrl);
  
    // Get a context (if already present, will be unchanged)
    context = Object(_loader_utils_get_loader_context__WEBPACK_IMPORTED_MODULE_4__["getLoaderContext"])({url: autoUrl, parse, loaders: candidateLoaders}, options, context);
  
    return await parseWithLoader(loader, data, options, context);
  }
  
  // TODO: support progress and abort
  // TODO - should accept loader.parseAsyncIterator and concatenate.
  async function parseWithLoader(loader, data, options, context) {
    Object(_loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_0__["validateLoaderVersion"])(loader);
  
    data = await Object(_loader_utils_get_data__WEBPACK_IMPORTED_MODULE_3__["getArrayBufferOrStringFromData"])(data, loader);
  
    // First check for synchronous text parser, wrap results in promises
    if (loader.parseTextSync && typeof data === 'string') {
      options.dataType = 'text';
      return loader.parseTextSync(data, options, context, loader);
    }
  
    // If we have a workerUrl and the loader can parse the given options efficiently in a worker
    if (Object(_loader_utils_parse_with_worker__WEBPACK_IMPORTED_MODULE_5__["canParseWithWorker"])(loader, data, options, context)) {
      return await Object(_loader_utils_parse_with_worker__WEBPACK_IMPORTED_MODULE_5__["default"])(loader, data, options, context);
    }
  
    // Check for asynchronous parser
    if (loader.parse) {
      return await loader.parse(data, options, context, loader);
    }
  
    // This should not happen, all sync loaders should also offer `parse` function
    Object(_loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_0__["assert"])(!loader.parseSync);
  
    // TBD - If asynchronous parser not available, return null
    return Object(_loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_0__["assert"])(false);
  }
  
  
  /***/ }),
  
  /***/ "../core/src/lib/progress/fetch-progress.js":
  /*!**************************************************!*\
    !*** ../core/src/lib/progress/fetch-progress.js ***!
    \**************************************************/
  /*! exports provided: default */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return fetchProgress; });
  // Forked from github AnthumChris/fetch-progress-indicators under MIT license
  /* global Response, ReadableStream */
  
  // Intercepts the Response stream and creates a new Response
  async function fetchProgress(
    response,
    onProgress,
    onDone = () => {},
    onError = () => {}
  ) {
    response = await response;
    if (!response.ok) {
      // ERROR checking needs to be done separately
      return response;
    }
    if (!response.body) {
      // 'ReadableStream not yet supported in this browser.
      return response;
    }
    const contentLength = response.headers.get('content-length');
    const totalBytes = contentLength && parseInt(contentLength, 10);
    if (!(contentLength > 0)) {
      return response;
    }
    // Currently override only implemented in browser
    if (typeof ReadableStream === 'undefined') {
      return response;
    }
  
    // Create a new stream that invisbly wraps original stream
    const progressStream = new ReadableStream({
      start(controller) {
        const reader = response.body.getReader();
        read(controller, reader, 0, totalBytes, onProgress, onDone, onError);
      }
    });
  
    return new Response(progressStream);
  }
  
  // Forward to original streams controller
  // TODO - this causes a crazy deep "async stack"... rewrite as async iterator?
  // eslint-disable-next-line max-params
  async function read(controller, reader, loadedBytes, totalBytes, onProgress, onDone, onError) {
    try {
      const {done, value} = await reader.read();
      if (done) {
        onDone();
        controller.close();
        return;
      }
      loadedBytes += value.byteLength;
      const percent = Math.round((loadedBytes / totalBytes) * 100);
      onProgress(percent, {loadedBytes, totalBytes});
      controller.enqueue(value);
      await read(controller, reader, loadedBytes, totalBytes, onProgress, onDone, onError);
    } catch (error) {
      controller.error(error);
      onError(error);
    }
  }
  
  
  /***/ }),
  
  /***/ "../core/src/lib/register-loaders.js":
  /*!*******************************************!*\
    !*** ../core/src/lib/register-loaders.js ***!
    \*******************************************/
  /*! exports provided: registerLoaders, getRegisteredLoaders, _unregisterLoaders */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerLoaders", function() { return registerLoaders; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getRegisteredLoaders", function() { return getRegisteredLoaders; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_unregisterLoaders", function() { return _unregisterLoaders; });
  /* harmony import */ var _loader_utils_normalize_loader__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./loader-utils/normalize-loader */ "../core/src/lib/loader-utils/normalize-loader.js");
  
  
  let registeredLoaders = [];
  
  function registerLoaders(loaders) {
    loaders = Array.isArray(loaders) ? loaders : [loaders];
  
    for (const loader of loaders) {
      const normalizedLoader = Object(_loader_utils_normalize_loader__WEBPACK_IMPORTED_MODULE_0__["normalizeLoader"])(loader);
      if (!registeredLoaders.find(registeredLoader => normalizedLoader === registeredLoader)) {
        // add to the beginning of the registeredLoaders, so the last registeredLoader get picked
        registeredLoaders.unshift(normalizedLoader);
      }
    }
  }
  
  function getRegisteredLoaders() {
    return registeredLoaders;
  }
  
  // For testing
  function _unregisterLoaders() {
    registeredLoaders = [];
  }
  
  
  /***/ }),
  
  /***/ "../core/src/lib/save.js":
  /*!*******************************!*\
    !*** ../core/src/lib/save.js ***!
    \*******************************/
  /*! exports provided: save, saveSync */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "save", function() { return save; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "saveSync", function() { return saveSync; });
  /* harmony import */ var _encode__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./encode */ "../core/src/lib/encode.js");
  /* harmony import */ var _fetch_write_file__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./fetch/write-file */ "../core/src/lib/fetch/write-file.js");
  
  
  
  function save(data, url, writer, options) {
    const encodedData = Object(_encode__WEBPACK_IMPORTED_MODULE_0__["encode"])(data, writer, options, url);
    return Object(_fetch_write_file__WEBPACK_IMPORTED_MODULE_1__["writeFile"])(url, encodedData);
  }
  
  function saveSync(data, url, writer, options) {
    const encodedData = Object(_encode__WEBPACK_IMPORTED_MODULE_0__["encodeSync"])(data, writer, options, url);
    return Object(_fetch_write_file__WEBPACK_IMPORTED_MODULE_1__["writeFileSync"])(url, encodedData);
  }
  
  
  /***/ }),
  
  /***/ "../core/src/lib/select-loader.js":
  /*!****************************************!*\
    !*** ../core/src/lib/select-loader.js ***!
    \****************************************/
  /*! exports provided: selectLoader */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectLoader", function() { return selectLoader; });
  /* harmony import */ var _register_loaders__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./register-loaders */ "../core/src/lib/register-loaders.js");
  /* harmony import */ var _loader_utils_normalize_loader__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./loader-utils/normalize-loader */ "../core/src/lib/loader-utils/normalize-loader.js");
  /* harmony import */ var _javascript_utils_is_type__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../javascript-utils/is-type */ "../core/src/javascript-utils/is-type.js");
  
  
  
  
  const EXT_PATTERN = /\.([^.]+)$/;
  const DATA_URL_PATTERN = /^data:(.*?)(;|,)/;
  
  // Find a loader that matches file extension and/or initial file content
  // Search the loaders array argument for a loader that matches url extension or initial data
  // Returns: a normalized loader
  
  // TODO - Need a variant that peeks at streams for parseInBatches
  // TODO - Detect multiple matching loaders? Use heuristics to grade matches?
  // TODO - Allow apps to pass context to disambiguate between multiple matches (e.g. multiple .json formats)?
  
  // eslint-disable-next-line complexity
  function selectLoader(loaders, url = '', data = null, {nothrow = false} = {}) {
    url = url || '';
  
    // if only a single loader was provided (not as array), force its use
    // TODO - Should this behaviour be kept and documented?
    if (loaders && !Array.isArray(loaders)) {
      const loader = loaders;
      Object(_loader_utils_normalize_loader__WEBPACK_IMPORTED_MODULE_1__["normalizeLoader"])(loader);
      return loader;
    }
  
    // If no loaders provided, get the registered loaders
    loaders = [...(loaders || []), ...Object(_register_loaders__WEBPACK_IMPORTED_MODULE_0__["getRegisteredLoaders"])()];
    normalizeLoaders(loaders);
  
    url = url.replace(/\?.*/, '');
    let loader = findLoaderByUrl(loaders, url);
    loader = loader || findLoaderByContentType(loaders, data);
    loader = loader || findLoaderByExamingInitialData(loaders, data);
  
    // no loader available
    if (!loader) {
      if (nothrow) {
        return null;
      }
      let message = 'No valid loader found';
      if (data) {
        message += ` for data starting with "${getFirstCharacters(data)}"`;
      }
      if (url) {
        message += ` for ${url}`;
      }
      throw new Error(message);
    }
  
    return loader;
  }
  
  function normalizeLoaders(loaders) {
    for (const loader of loaders) {
      Object(_loader_utils_normalize_loader__WEBPACK_IMPORTED_MODULE_1__["normalizeLoader"])(loader);
    }
  }
  
  // TODO - Would be nice to support http://example.com/file.glb?parameter=1
  // E.g: x = new URL('http://example.com/file.glb?load=1'; x.pathname
  function findLoaderByUrl(loaders, url) {
    // Check for data url
    let match = url.match(DATA_URL_PATTERN);
    const mimeType = match && match[1];
    if (mimeType) {
      return findLoaderByMimeType(loaders, mimeType);
    }
    // Get extension
    match = url.match(EXT_PATTERN);
    const extension = match && match[1];
    return extension && findLoaderByExtension(loaders, extension);
  }
  
  function findLoaderByMimeType(loaders, mimeType) {
    for (const loader of loaders) {
      if (loader.mimeTypes && loader.mimeTypes.includes(mimeType)) {
        return loader;
      }
    }
    return null;
  }
  
  function findLoaderByExtension(loaders, extension) {
    extension = extension.toLowerCase();
  
    for (const loader of loaders) {
      for (const loaderExtension of loader.extensions) {
        if (loaderExtension.toLowerCase() === extension) {
          return loader;
        }
      }
    }
    return null;
  }
  
  // data should be a Response object
  function findLoaderByContentType(loaders, data) {
    if (!data || !Object(_javascript_utils_is_type__WEBPACK_IMPORTED_MODULE_2__["isFetchResponse"])(data) || !data.headers) {
      return null;
    }
  
    const contentType = data.headers.get('content-type');
    return findLoaderByMimeType(loaders, contentType);
  }
  
  function findLoaderByExamingInitialData(loaders, data) {
    if (!data) {
      return null;
    }
  
    for (const loader of loaders) {
      if (typeof data === 'string') {
        if (testText(data, loader)) {
          return loader;
        }
      } else if (ArrayBuffer.isView(data)) {
        // Typed Arrays can have offsets into underlying buffer
        if (testBinary(data.buffer, data.byteOffset, loader)) {
          return loader;
        }
      } else if (data instanceof ArrayBuffer) {
        const byteOffset = 0;
        if (testBinary(data, byteOffset, loader)) {
          return loader;
        }
      }
      // TODO Handle streaming case (requires creating a new AsyncIterator)
    }
    return null;
  }
  
  function testText(data, loader) {
    return loader.testText && loader.testText(data);
  }
  
  function testBinary(data, byteOffset, loader) {
    const type = Array.isArray(loader.test) ? 'array' : typeof loader.test;
    switch (type) {
      case 'function':
        return loader.test(data, loader);
  
      case 'string':
      case 'array':
        // Magic bytes check: If `loader.test` is a string or array of strings,
        // check if binary data starts with one of those strings
        const tests = Array.isArray(loader.test) ? loader.test : [loader.test];
        return tests.some(test => {
          const magic = getMagicString(data, byteOffset, test.length);
          return test === magic;
        });
  
      default:
        return false;
    }
  }
  
  function getFirstCharacters(data, length = 5) {
    if (typeof data === 'string') {
      return data.slice(0, length);
    } else if (ArrayBuffer.isView(data)) {
      // Typed Arrays can have offsets into underlying buffer
      return getMagicString(data.buffer, data.byteOffset, length);
    } else if (data instanceof ArrayBuffer) {
      const byteOffset = 0;
      return getMagicString(data, byteOffset, length);
    }
    return '';
  }
  
  function getMagicString(arrayBuffer, byteOffset, length) {
    if (arrayBuffer.byteLength <= byteOffset + length) {
      return '';
    }
    const dataView = new DataView(arrayBuffer);
    let magic = '';
    for (let i = 0; i < length; i++) {
      magic += String.fromCharCode(dataView.getUint8(byteOffset + i));
    }
    return magic;
  }
  
  
  /***/ }),
  
  /***/ "../core/src/lib/set-loader-options.js":
  /*!*********************************************!*\
    !*** ../core/src/lib/set-loader-options.js ***!
    \*********************************************/
  /*! exports provided: setLoaderOptions */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setLoaderOptions", function() { return setLoaderOptions; });
  /* harmony import */ var _loader_utils_merge_options__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./loader-utils/merge-options */ "../core/src/lib/loader-utils/merge-options.js");
  
  
  // Set global loader options
  function setLoaderOptions(options) {
    Object(_loader_utils_merge_options__WEBPACK_IMPORTED_MODULE_0__["setGlobalOptions"])(options);
  }
  
  
  /***/ }),
  
  /***/ "../core/src/worker-utils/get-worker-url.js":
  /*!**************************************************!*\
    !*** ../core/src/worker-utils/get-worker-url.js ***!
    \**************************************************/
  /*! exports provided: getWorkerURL */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getWorkerURL", function() { return getWorkerURL; });
  /* harmony import */ var _loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @loaders.gl/loader-utils */ "../loader-utils/src/index.js");
  /* global URL, Blob */
  
  
  const workerURLCache = new Map();
  
  // Creates a URL from worker source that can be used to create `Worker` instances
  // Packages (and then caches) the result of `webworkify` as an "Object URL"
  function getWorkerURL(workerSource, workerName = 'Worker') {
    Object(_loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_0__["assert"])(typeof workerSource === 'string', 'worker source');
  
    // CASE: url(./worker.js)
    // This pattern is used to differentiate worker urls from worker source code
    // Load from url is needed for testing, when using Webpack & webworker target
    if (workerSource.startsWith('url(') && workerSource.endsWith(')')) {
      const workerUrl = workerSource.match(/^url\((.*)\)$/)[1];
  
      // A local script url, we can use it to initialize a Worker directly
      if (workerUrl && !workerUrl.startsWith('http')) {
        return workerUrl;
      }
  
      // Per spec, worker cannot be initialized with a script from a different origin
      // However a local worker script can still import scripts from other origins,
      // so we simply build a wrapper script
      workerSource = buildScript(workerUrl);
    }
  
    let workerURL = workerURLCache.get(workerSource);
  
    if (!workerURL) {
      // NOTE: webworkify was previously used
      // const blob = webworkify(workerSource, {bare: true});
      const blob = new Blob([workerSource], {type: 'application/javascript'});
      workerURL = URL.createObjectURL(blob);
      workerURLCache.set(workerSource, workerURL);
    }
  
    return workerURL;
  }
  
  // Only use trusted sources!
  function buildScript(workerUrl) {
    return `\
  try {
    importScripts('${workerUrl}');
  } catch (error) {
    console.error(error);
  }`;
  }
  
  
  /***/ }),
  
  /***/ "../core/src/worker-utils/worker-farm.js":
  /*!***********************************************!*\
    !*** ../core/src/worker-utils/worker-farm.js ***!
    \***********************************************/
  /*! exports provided: default */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return WorkerFarm; });
  /* harmony import */ var _worker_pool__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./worker-pool */ "../core/src/worker-utils/worker-pool.js");
  
  
  const DEFAULT_MAX_CONCURRENCY = 5;
  
  /**
   * Process multiple data messages with a "farm" of different workers (in worker pools)
   */
  class WorkerFarm {
    static isSupported() {
      return typeof Worker !== 'undefined';
    }
  
    /**
     * @param processor {function | string} - worker function
     * @param maxConcurrency {number} - max count of workers
     */
    constructor({maxConcurrency = DEFAULT_MAX_CONCURRENCY, onMessage, onDebug = () => {}}) {
      this.maxConcurrency = maxConcurrency;
      this.onMessage = onMessage;
      this.onDebug = onDebug;
      this.workerPools = new Map();
    }
  
    setProps(props) {
      if ('maxConcurrency' in props) {
        this.maxConcurrency = props.maxConcurrency;
      }
  
      if ('onDebug' in props) {
        this.onDebug = props.onDebug;
      }
    }
  
    destroy() {
      this.workerPools.forEach(workerPool => workerPool.destroy());
    }
  
    /**
     * Process binary data in a worker
     * @param {any} data - data (containing binary typed arrays) to be transferred to worker
     * @returns a Promise with data containing typed arrays transferred back from work
     */
    async process(workerSource, workerName, data) {
      const workerPool = this._getWorkerPool(workerSource, workerName);
      return workerPool.process(data);
    }
  
    // PRIVATE
  
    _getWorkerPool(workerSource, workerName) {
      let workerPool = this.workerPools.get(workerName);
      if (!workerPool) {
        workerPool = new _worker_pool__WEBPACK_IMPORTED_MODULE_0__["default"]({
          source: workerSource,
          name: workerName,
          onMessage: this.onMessage,
          maxConcurrency: this.maxConcurrency,
          onDebug: this.onDebug
        });
        this.workerPools.set(workerName, workerPool);
      }
      return workerPool;
    }
  }
  
  
  /***/ }),
  
  /***/ "../core/src/worker-utils/worker-pool.js":
  /*!***********************************************!*\
    !*** ../core/src/worker-utils/worker-pool.js ***!
    \***********************************************/
  /*! exports provided: default */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return WorkerPool; });
  /* harmony import */ var _worker_thread__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./worker-thread */ "../core/src/worker-utils/worker-thread.js");
  
  
  /**
   * Process multiple data messages with small pool of identical workers
   */
  class WorkerPool {
    /**
     * @param {function | string} processor - worker function
     * @param {number} maxConcurrency - max count of workers
     */
    constructor({source, name = 'unnamed', maxConcurrency = 1, onMessage, onDebug = () => {}}) {
      this.source = source;
      this.name = name;
      this.maxConcurrency = maxConcurrency;
      this.onMessage = onMessage;
      this.onDebug = onDebug;
  
      this.jobQueue = [];
      this.idleQueue = [];
      this.count = 0;
      this.isDestroyed = false;
    }
  
    destroy() {
      // Destroy idle workers, active Workers will be destroyed on completion
      this.idleQueue.forEach(worker => worker.destroy());
      this.isDestroyed = true;
    }
  
    /**
     * Process binary data in a worker
     * @param data {data containing binary typed arrays} - data to be transferred to worker
     * @returns a Promise with data containing typed arrays transferred back from work
     */
    async process(data, jobName) {
      return new Promise((resolve, reject) => {
        this.jobQueue.push({data, jobName, resolve, reject});
        this._startQueuedJob();
      });
    }
  
    // PRIVATE
  
    _startQueuedJob() {
      if (!this.jobQueue.length) {
        return;
      }
      const worker = this._getAvailableWorker();
      if (!worker) {
        return;
      }
  
      // We have a worker, dequeue and start the job
      const job = this.jobQueue.shift();
  
      this.onDebug({
        message: 'processing',
        worker: worker.name,
        job: job.jobName,
        backlog: this.jobQueue.length
      });
  
      worker
        .process(job.data)
        .then(result => job.resolve(result))
        .catch(error => job.reject(error))
        .then(() => this._onWorkerDone(worker));
    }
  
    _onWorkerDone(worker) {
      if (this.isDestroyed) {
        worker.destroy();
      } else {
        this.idleQueue.push(worker);
        this._startQueuedJob();
      }
    }
  
    _getAvailableWorker() {
      // If a worker has completed and returned to the queue, it can be used
      if (this.idleQueue.length > 0) {
        return this.idleQueue.shift();
      }
  
      // Create fresh worker if we haven't yet created the max amount of worker threads for this worker source
      if (this.count < this.maxConcurrency) {
        this.count++;
        const name = `${this.name.toLowerCase()} (#${this.count} of ${this.maxConcurrency})`;
        return new _worker_thread__WEBPACK_IMPORTED_MODULE_0__["default"]({source: this.source, onMessage: this.onMessage, name});
      }
  
      // No worker available, have to wait
      return null;
    }
  }
  
  
  /***/ }),
  
  /***/ "../core/src/worker-utils/worker-thread.js":
  /*!*************************************************!*\
    !*** ../core/src/worker-utils/worker-thread.js ***!
    \*************************************************/
  /*! exports provided: default */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return WorkerThread; });
  /* harmony import */ var _get_worker_url__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./get-worker-url */ "../core/src/worker-utils/get-worker-url.js");
  /* harmony import */ var _loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @loaders.gl/loader-utils */ "../loader-utils/src/index.js");
  /* global Worker */
  
  
  
  let count = 0;
  
  // By default resolves to the first message the worker sends back
  function defaultOnMessage({data, resolve}) {
    resolve(data);
  }
  
  class WorkerThread {
    constructor({source, name = `web-worker-${count++}`, onMessage}) {
      const url = Object(_get_worker_url__WEBPACK_IMPORTED_MODULE_0__["getWorkerURL"])(source, name);
      this.worker = new Worker(url, {name});
      this.name = name;
      this.onMessage = onMessage || defaultOnMessage;
    }
  
    /**
     * Process binary data in a worker
     * @param data {data containing binary typed arrays} - data to be transferred to worker
     * @returns a Promise with data containing typed arrays transferred back from work
     */
    async process(data) {
      return new Promise((resolve, reject) => {
        this.worker.onmessage = event =>
          this.onMessage({worker: this.worker, data: event.data, resolve, reject});
        this.worker.onerror = error => {
          // Note Error object does not have the expected fields if loading failed completely
          // https://developer.mozilla.org/en-US/docs/Web/API/Worker#Event_handlers
          // https://developer.mozilla.org/en-US/docs/Web/API/ErrorEvent
          let message = `${this.name}: WorkerThread.process() failed`;
          if (error.message) {
            message += ` ${error.message} ${error.filename}:${error.lineno}:${error.colno}`;
          }
          const betterError = new Error(message);
          console.error(error); // eslint-disable-line
          reject(betterError);
        };
        const transferList = Object(_loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_1__["getTransferList"])(data);
        this.worker.postMessage(data, transferList);
      });
    }
  
    destroy() {
      this.worker.terminate();
      this.worker = null;
    }
  }
  
  
  /***/ }),
  
  /***/ "../loader-utils/src/categories/mesh/mesh-utils.js":
  /*!*********************************************************!*\
    !*** ../loader-utils/src/categories/mesh/mesh-utils.js ***!
    \*********************************************************/
  /*! exports provided: getMeshSize, getMeshBoundingBox */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getMeshSize", function() { return getMeshSize; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getMeshBoundingBox", function() { return getMeshBoundingBox; });
  function getMeshSize(attributes) {
    let size = 0;
    for (const attributeName in attributes) {
      const attribute = attributes[attributeName];
      if (ArrayBuffer.isView(attribute)) {
        // @ts-ignore DataView doesn't have BYTES_PER_ELEMENT
        size += attribute.byteLength * attribute.BYTES_PER_ELEMENT;
      }
    }
    return size;
  }
  
  /* eslint-disable-next-line complexity */
  function getMeshBoundingBox(attributes) {
    if (!attributes || !attributes.POSITION) {
      return null;
    }
  
    let minX = Infinity;
    let minY = Infinity;
    let minZ = Infinity;
    let maxX = -Infinity;
    let maxY = -Infinity;
    let maxZ = -Infinity;
  
    const positions = attributes.POSITION.value;
    const len = positions && positions.length;
  
    if (!len) {
      return null;
    }
  
    for (let i = 0; i < len; i += 3) {
      const x = positions[i];
      const y = positions[i + 1];
      const z = positions[i + 2];
  
      minX = x < minX ? x : minX;
      minY = y < minY ? y : minY;
      minZ = z < minZ ? z : minZ;
  
      maxX = x > maxX ? x : maxX;
      maxY = y > maxY ? y : maxY;
      maxZ = z > maxZ ? z : maxZ;
    }
    return [[minX, minY, minZ], [maxX, maxY, maxZ]];
  }
  
  
  /***/ }),
  
  /***/ "../loader-utils/src/index.js":
  /*!************************************!*\
    !*** ../loader-utils/src/index.js ***!
    \************************************/
  /*! exports provided: createWorker, assert, isBrowser, isWorker, nodeVersion, self, window, global, document, getLibraryUrl, loadLibrary, getTransferList, validateLoaderVersion, parseJSON, padTo4Bytes, copyToArray, copyArrayBuffer, getZeroOffsetArrayBuffer, copyPaddedArrayBufferToDataView, copyPaddedStringToDataView, padStringToByteAlignment, copyStringToDataView, copyBinaryToDataView, getFirstCharacters, getMagicString, path, setPathPrefix, getPathPrefix, resolvePath, _addAliases, RequestScheduler, _getMeshSize, getMeshBoundingBox */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony import */ var _lib_create_worker__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./lib/create-worker */ "../loader-utils/src/lib/create-worker.js");
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createWorker", function() { return _lib_create_worker__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  
  /* harmony import */ var _lib_env_utils_assert__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./lib/env-utils/assert */ "../loader-utils/src/lib/env-utils/assert.js");
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "assert", function() { return _lib_env_utils_assert__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  
  /* harmony import */ var _lib_env_utils_globals__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./lib/env-utils/globals */ "../loader-utils/src/lib/env-utils/globals.js");
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isBrowser", function() { return _lib_env_utils_globals__WEBPACK_IMPORTED_MODULE_2__["isBrowser"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isWorker", function() { return _lib_env_utils_globals__WEBPACK_IMPORTED_MODULE_2__["isWorker"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "nodeVersion", function() { return _lib_env_utils_globals__WEBPACK_IMPORTED_MODULE_2__["nodeVersion"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "self", function() { return _lib_env_utils_globals__WEBPACK_IMPORTED_MODULE_2__["self"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "window", function() { return _lib_env_utils_globals__WEBPACK_IMPORTED_MODULE_2__["window"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "global", function() { return _lib_env_utils_globals__WEBPACK_IMPORTED_MODULE_2__["global"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "document", function() { return _lib_env_utils_globals__WEBPACK_IMPORTED_MODULE_2__["document"]; });
  
  /* harmony import */ var _lib_library_utils_library_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./lib/library-utils/library-utils */ "../loader-utils/src/lib/library-utils/library-utils.js");
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getLibraryUrl", function() { return _lib_library_utils_library_utils__WEBPACK_IMPORTED_MODULE_3__["getLibraryUrl"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "loadLibrary", function() { return _lib_library_utils_library_utils__WEBPACK_IMPORTED_MODULE_3__["loadLibrary"]; });
  
  /* harmony import */ var _lib_worker_utils_get_transfer_list__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./lib/worker-utils/get-transfer-list */ "../loader-utils/src/lib/worker-utils/get-transfer-list.js");
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getTransferList", function() { return _lib_worker_utils_get_transfer_list__WEBPACK_IMPORTED_MODULE_4__["getTransferList"]; });
  
  /* harmony import */ var _lib_validate_loader_version__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./lib/validate-loader-version */ "../loader-utils/src/lib/validate-loader-version.js");
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "validateLoaderVersion", function() { return _lib_validate_loader_version__WEBPACK_IMPORTED_MODULE_5__["validateLoaderVersion"]; });
  
  /* harmony import */ var _lib_parser_utils_parse_json__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./lib/parser-utils/parse-json */ "../loader-utils/src/lib/parser-utils/parse-json.js");
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "parseJSON", function() { return _lib_parser_utils_parse_json__WEBPACK_IMPORTED_MODULE_6__["parseJSON"]; });
  
  /* harmony import */ var _lib_binary_utils_memory_copy_utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./lib/binary-utils/memory-copy-utils */ "../loader-utils/src/lib/binary-utils/memory-copy-utils.js");
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "padTo4Bytes", function() { return _lib_binary_utils_memory_copy_utils__WEBPACK_IMPORTED_MODULE_7__["padTo4Bytes"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "copyToArray", function() { return _lib_binary_utils_memory_copy_utils__WEBPACK_IMPORTED_MODULE_7__["copyToArray"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "copyArrayBuffer", function() { return _lib_binary_utils_memory_copy_utils__WEBPACK_IMPORTED_MODULE_7__["copyArrayBuffer"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getZeroOffsetArrayBuffer", function() { return _lib_binary_utils_memory_copy_utils__WEBPACK_IMPORTED_MODULE_7__["getZeroOffsetArrayBuffer"]; });
  
  /* harmony import */ var _lib_binary_utils_binary_copy_utils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./lib/binary-utils/binary-copy-utils */ "../loader-utils/src/lib/binary-utils/binary-copy-utils.js");
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "copyPaddedArrayBufferToDataView", function() { return _lib_binary_utils_binary_copy_utils__WEBPACK_IMPORTED_MODULE_8__["copyPaddedArrayBufferToDataView"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "copyPaddedStringToDataView", function() { return _lib_binary_utils_binary_copy_utils__WEBPACK_IMPORTED_MODULE_8__["copyPaddedStringToDataView"]; });
  
  /* harmony import */ var _lib_binary_utils_encode_utils__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./lib/binary-utils/encode-utils */ "../loader-utils/src/lib/binary-utils/encode-utils.js");
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "padStringToByteAlignment", function() { return _lib_binary_utils_encode_utils__WEBPACK_IMPORTED_MODULE_9__["padStringToByteAlignment"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "copyStringToDataView", function() { return _lib_binary_utils_encode_utils__WEBPACK_IMPORTED_MODULE_9__["copyStringToDataView"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "copyBinaryToDataView", function() { return _lib_binary_utils_encode_utils__WEBPACK_IMPORTED_MODULE_9__["copyBinaryToDataView"]; });
  
  /* harmony import */ var _lib_binary_utils_get_first_characters__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./lib/binary-utils/get-first-characters */ "../loader-utils/src/lib/binary-utils/get-first-characters.js");
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getFirstCharacters", function() { return _lib_binary_utils_get_first_characters__WEBPACK_IMPORTED_MODULE_10__["getFirstCharacters"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getMagicString", function() { return _lib_binary_utils_get_first_characters__WEBPACK_IMPORTED_MODULE_10__["getMagicString"]; });
  
  /* harmony import */ var _lib_path_utils_path__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./lib/path-utils/path */ "../loader-utils/src/lib/path-utils/path.js");
  /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "path", function() { return _lib_path_utils_path__WEBPACK_IMPORTED_MODULE_11__; });
  /* harmony import */ var _lib_path_utils_file_aliases__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./lib/path-utils/file-aliases */ "../loader-utils/src/lib/path-utils/file-aliases.js");
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setPathPrefix", function() { return _lib_path_utils_file_aliases__WEBPACK_IMPORTED_MODULE_12__["setPathPrefix"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getPathPrefix", function() { return _lib_path_utils_file_aliases__WEBPACK_IMPORTED_MODULE_12__["getPathPrefix"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "resolvePath", function() { return _lib_path_utils_file_aliases__WEBPACK_IMPORTED_MODULE_12__["resolvePath"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_addAliases", function() { return _lib_path_utils_file_aliases__WEBPACK_IMPORTED_MODULE_12__["addAliases"]; });
  
  /* harmony import */ var _lib_request_utils_request_scheduler__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./lib/request-utils/request-scheduler */ "../loader-utils/src/lib/request-utils/request-scheduler.js");
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RequestScheduler", function() { return _lib_request_utils_request_scheduler__WEBPACK_IMPORTED_MODULE_13__["default"]; });
  
  /* harmony import */ var _categories_mesh_mesh_utils__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./categories/mesh/mesh-utils */ "../loader-utils/src/categories/mesh/mesh-utils.js");
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_getMeshSize", function() { return _categories_mesh_mesh_utils__WEBPACK_IMPORTED_MODULE_14__["getMeshSize"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getMeshBoundingBox", function() { return _categories_mesh_mesh_utils__WEBPACK_IMPORTED_MODULE_14__["getMeshBoundingBox"]; });
  
  
  
  // GENERAL UTILS
  
  
  
  // LIBRARY UTILS
  
  
  // WORKER UTILS
  
  
  
  // PARSER UTILS
  
  
  // MEMORY COPY UTILS
  
  
  
  
  
  // PATH UTILS
  
  
  
  
  
  
  // REQUEST UTILS
  
  
  // MESH CATEGORY UTILS
  // Note: Should move to category specific module if code size increases
  
  
  
  /***/ }),
  
  /***/ "../loader-utils/src/lib/binary-utils/binary-copy-utils.js":
  /*!*****************************************************************!*\
    !*** ../loader-utils/src/lib/binary-utils/binary-copy-utils.js ***!
    \*****************************************************************/
  /*! exports provided: copyPaddedArrayBufferToDataView, copyPaddedStringToDataView */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "copyPaddedArrayBufferToDataView", function() { return copyPaddedArrayBufferToDataView; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "copyPaddedStringToDataView", function() { return copyPaddedStringToDataView; });
  /* harmony import */ var _memory_copy_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./memory-copy-utils */ "../loader-utils/src/lib/binary-utils/memory-copy-utils.js");
  /* global TextEncoder */
  
  
  function copyPaddedArrayBufferToDataView(dataView, byteOffset, sourceBuffer, padding) {
    const paddedLength = Object(_memory_copy_utils__WEBPACK_IMPORTED_MODULE_0__["padTo4Bytes"])(sourceBuffer.byteLength);
    const padLength = paddedLength - sourceBuffer.byteLength;
  
    if (dataView) {
      // Copy array
      const targetArray = new Uint8Array(
        dataView.buffer,
        dataView.byteOffset + byteOffset,
        sourceBuffer.byteLength
      );
      const sourceArray = new Uint8Array(sourceBuffer);
      targetArray.set(sourceArray);
  
      // Add PADDING
      for (let i = 0; i < padLength; ++i) {
        // json chunk is padded with spaces (ASCII 0x20)
        dataView.setUint8(byteOffset + sourceBuffer.byteLength + i, 0x20);
      }
    }
    byteOffset += paddedLength;
    return byteOffset;
  }
  
  function copyPaddedStringToDataView(dataView, byteOffset, string, padding) {
    const textEncoder = new TextEncoder();
    // PERFORMANCE IDEA: We encode twice, once to get size and once to store
    // PERFORMANCE IDEA: Use TextEncoder.encodeInto() to avoid temporary copy
    const stringBuffer = textEncoder.encode(string);
  
    byteOffset = copyPaddedArrayBufferToDataView(dataView, byteOffset, stringBuffer, padding);
  
    return byteOffset;
  }
  
  
  /***/ }),
  
  /***/ "../loader-utils/src/lib/binary-utils/encode-utils.js":
  /*!************************************************************!*\
    !*** ../loader-utils/src/lib/binary-utils/encode-utils.js ***!
    \************************************************************/
  /*! exports provided: padStringToByteAlignment, copyStringToDataView, copyBinaryToDataView */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "padStringToByteAlignment", function() { return padStringToByteAlignment; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "copyStringToDataView", function() { return copyStringToDataView; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "copyBinaryToDataView", function() { return copyBinaryToDataView; });
  // UTILITIES
  
  // PERFORMANCE IDEA: No need to copy string twice...
  function padStringToByteAlignment(string, byteAlignment) {
    const length = string.length;
    const paddedLength = Math.ceil(length / byteAlignment) * byteAlignment; // Round up to the required alignment
    const padding = paddedLength - length;
    let whitespace = '';
    for (let i = 0; i < padding; ++i) {
      whitespace += ' ';
    }
    return string + whitespace;
  }
  
  function copyStringToDataView(dataView, byteOffset, string, byteLength) {
    if (dataView) {
      for (let i = 0; i < byteLength; i++) {
        dataView.setUint8(byteOffset + i, string.charCodeAt(i));
      }
    }
    return byteOffset + byteLength;
  }
  
  function copyBinaryToDataView(dataView, byteOffset, binary, byteLength) {
    if (dataView) {
      for (let i = 0; i < byteLength; i++) {
        dataView.setUint8(byteOffset + i, binary[i]);
        byteOffset++;
      }
    }
    return byteOffset + byteLength;
  }
  
  
  /***/ }),
  
  /***/ "../loader-utils/src/lib/binary-utils/get-first-characters.js":
  /*!********************************************************************!*\
    !*** ../loader-utils/src/lib/binary-utils/get-first-characters.js ***!
    \********************************************************************/
  /*! exports provided: getFirstCharacters, getMagicString */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getFirstCharacters", function() { return getFirstCharacters; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getMagicString", function() { return getMagicString; });
  function getFirstCharacters(data, length = 5) {
    if (typeof data === 'string') {
      return data.slice(0, length);
    } else if (ArrayBuffer.isView(data)) {
      // Typed Arrays can have offsets into underlying buffer
      return getMagicString(data.buffer, data.byteOffset, length);
    } else if (data instanceof ArrayBuffer) {
      const byteOffset = 0;
      return getMagicString(data, byteOffset, length);
    }
    return '';
  }
  
  function getMagicString(arrayBuffer, byteOffset, length) {
    if (arrayBuffer.byteLength <= byteOffset + length) {
      return '';
    }
    const dataView = new DataView(arrayBuffer);
    let magic = '';
    for (let i = 0; i < length; i++) {
      magic += String.fromCharCode(dataView.getUint8(byteOffset + i));
    }
    return magic;
  }
  
  
  /***/ }),
  
  /***/ "../loader-utils/src/lib/binary-utils/memory-copy-utils.js":
  /*!*****************************************************************!*\
    !*** ../loader-utils/src/lib/binary-utils/memory-copy-utils.js ***!
    \*****************************************************************/
  /*! exports provided: padTo4Bytes, getZeroOffsetArrayBuffer, copyArrayBuffer, copyToArray */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "padTo4Bytes", function() { return padTo4Bytes; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getZeroOffsetArrayBuffer", function() { return getZeroOffsetArrayBuffer; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "copyArrayBuffer", function() { return copyArrayBuffer; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "copyToArray", function() { return copyToArray; });
  function padTo4Bytes(byteLength) {
    return (byteLength + 3) & ~3;
  }
  
  // Copy a view of an ArrayBuffer into new ArrayBuffer with byteOffset = 0
  function getZeroOffsetArrayBuffer(arrayBuffer, byteOffset, byteLength) {
    const subArray = byteLength
      ? new Uint8Array(arrayBuffer).subarray(byteOffset, byteOffset + byteLength)
      : new Uint8Array(arrayBuffer).subarray(byteOffset);
    const arrayCopy = new Uint8Array(subArray);
    return arrayCopy.buffer;
  }
  
  /* Creates a new Uint8Array based on two different ArrayBuffers
   * @private
   * @param {ArrayBuffers} buffer1 The first buffer.
   * @param {ArrayBuffers} buffer2 The second buffer.
   * @return {ArrayBuffers} The new ArrayBuffer created out of the two.
   */
  function copyArrayBuffer(
    targetBuffer,
    sourceBuffer,
    byteOffset,
    byteLength = sourceBuffer.byteLength
  ) {
    const targetArray = new Uint8Array(targetBuffer, byteOffset, byteLength);
    const sourceArray = new Uint8Array(sourceBuffer);
    targetArray.set(sourceArray);
    return targetBuffer;
  }
  
  /**
   * Copy from source to target at the targetOffset
   *
   * @param {ArrayBuffer|any} source - The data to copy
   * @param {any} target - The destination to copy data into
   * @param {Number} targetOffset - The start offset into target to place the copied data
   *
   * @return {Number} Returns the new offset taking into account proper padding
   */
  function copyToArray(source, target, targetOffset) {
    let sourceArray;
  
    if (source instanceof ArrayBuffer) {
      sourceArray = new Uint8Array(source);
    } else {
      // Pack buffer onto the big target array
      //
      // 'source.data.buffer' could be a view onto a larger buffer.
      // We MUST use this constructor to ensure the byteOffset and byteLength is
      // set to correct values from 'source.data' and not the underlying
      // buffer for target.set() to work properly.
      const srcByteOffset = source.byteOffset;
      const srcByteLength = source.byteLength;
      sourceArray = new Uint8Array(source.buffer, srcByteOffset, srcByteLength);
    }
  
    // Pack buffer onto the big target array
    target.set(sourceArray, targetOffset);
  
    return targetOffset + padTo4Bytes(sourceArray.byteLength);
  }
  
  
  /***/ }),
  
  /***/ "../loader-utils/src/lib/create-worker.js":
  /*!************************************************!*\
    !*** ../loader-utils/src/lib/create-worker.js ***!
    \************************************************/
  /*! exports provided: default */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return createWorker; });
  /* harmony import */ var _worker_utils_get_transfer_list__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./worker-utils/get-transfer-list */ "../loader-utils/src/lib/worker-utils/get-transfer-list.js");
  /* harmony import */ var _validate_loader_version__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./validate-loader-version */ "../loader-utils/src/lib/validate-loader-version.js");
  /* eslint-disable no-restricted-globals */
  /* global TextDecoder, self */
  
  
  
  
  // Set up a WebWorkerGlobalScope to talk with the main thread
  function createWorker(loader) {
    // TODO - explain when this happens? Just a sanity check? Throw an error or log a warning?
    if (typeof self === 'undefined') {
      return;
    }
  
    let requestId = 0;
    const parse = (arraybuffer, options = {}, url) =>
      new Promise((resolve, reject) => {
        const id = requestId++;
  
        const onMessage = ({data}) => {
          if (!data || data.id !== id) {
            // not ours
            return;
          }
          switch (data.type) {
            case 'parse-done':
              self.removeEventListener('message', onMessage);
              resolve(data.result);
              break;
  
            case 'parse-error':
              self.removeEventListener('message', onMessage);
              reject(data.message);
              break;
  
            default:
            // ignore
          }
        };
        self.addEventListener('message', onMessage);
        // Ask the main thread to decode data
        // @ts-ignore self is WorkerGlobalScope
        self.postMessage({type: 'parse', id, arraybuffer, options, url}, [arraybuffer]);
      });
  
    self.onmessage = async evt => {
      const {data} = evt;
  
      try {
        if (!isKnownMessage(data, loader.name)) {
          return;
        }
  
        Object(_validate_loader_version__WEBPACK_IMPORTED_MODULE_1__["validateLoaderVersion"])(loader, data.source.split('@')[1]);
  
        const {arraybuffer, byteOffset = 0, byteLength = 0, options = {}} = data;
  
        const result = await parseData({
          loader,
          arraybuffer,
          byteOffset,
          byteLength,
          options,
          context: {parse}
        });
        const transferList = Object(_worker_utils_get_transfer_list__WEBPACK_IMPORTED_MODULE_0__["getTransferList"])(result);
        // @ts-ignore self is WorkerGlobalScope
        self.postMessage({type: 'done', result}, transferList);
      } catch (error) {
        // @ts-ignore self is WorkerGlobalScope
        self.postMessage({type: 'error', message: error.message});
      }
    };
  }
  
  // TODO - Support byteOffset and byteLength (enabling parsing of embedded binaries without copies)
  // TODO - Why not support async loader.parse* funcs here?
  // TODO - Why not reuse a common function instead of reimplementing loader.parse* selection logic? Keeping loader small?
  // TODO - Lack of appropriate parser functions can be detected when we create worker, no need to wait until parse
  async function parseData({loader, arraybuffer, byteOffset, byteLength, options, context}) {
    let data;
    let parser;
    if (loader.parseSync || loader.parse) {
      data = arraybuffer;
      parser = loader.parseSync || loader.parse;
    } else if (loader.parseTextSync) {
      const textDecoder = new TextDecoder();
      data = textDecoder.decode(arraybuffer);
      parser = loader.parseTextSync;
    } else {
      throw new Error(`Could not load data with ${loader.name} loader`);
    }
  
    // TODO - proper merge in of loader options...
    options = {
      ...options,
      modules: (loader && loader.options && loader.options.modules) || {},
      worker: false
    };
  
    return await parser(data, {...options}, context, loader);
  }
  
  // Filter out noise messages sent to workers
  function isKnownMessage(data, name) {
    return data && data.type === 'parse' && data.source && data.source.startsWith('loaders.gl');
  }
  
  /*
  function checkMessage(evt, name) {
    switch (evt.data && evt.data.source) {
      // Ignore known noise event from react-dev-tools bridge, webpack build progress etc...
      case 'react-devtools-bridge':
      case 'react-devtools-content-script':
      case 'react-devtools-detector':
        return false;
      default:
        // fall through
    }
  
    switch (evt.data && evt.data.type) {
      case 'webpackProgress':
      case 'webpackOk':
        return false;
      default:
        // Enable to debug messages
        // const message = `${name.toLowerCase()}-worker: ignoring unknown message`;
        // console.log(message, evt.data, evt); // eslint-disable-line
        return false;
    }
  }
  */
  
  
  /***/ }),
  
  /***/ "../loader-utils/src/lib/env-utils/assert.js":
  /*!***************************************************!*\
    !*** ../loader-utils/src/lib/env-utils/assert.js ***!
    \***************************************************/
  /*! exports provided: default */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return assert; });
  // Replacement for the external assert method to reduce bundle size
  // Note: We don't use the second "message" argument in calling code,
  // so no need to support it here
  function assert(condition, message) {
    if (!condition) {
      throw new Error(message || 'loader assertion failed.');
    }
  }
  
  
  /***/ }),
  
  /***/ "../loader-utils/src/lib/env-utils/globals.js":
  /*!****************************************************!*\
    !*** ../loader-utils/src/lib/env-utils/globals.js ***!
    \****************************************************/
  /*! exports provided: self, window, global, document, isBrowser, isWorker, nodeVersion */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* WEBPACK VAR INJECTION */(function(global, process) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "self", function() { return self_; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "window", function() { return window_; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "global", function() { return global_; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "document", function() { return document_; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isBrowser", function() { return isBrowser; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isWorker", function() { return isWorker; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "nodeVersion", function() { return nodeVersion; });
  // Copyright (c) 2015 - 2017 Uber Technologies, Inc.
  //
  // Permission is hereby granted, free of charge, to any person obtaining a copy
  // of this software and associated documentation files (the "Software"), to deal
  // in the Software without restriction, including without limitation the rights
  // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  // copies of the Software, and to permit persons to whom the Software is
  // furnished to do so, subject to the following conditions:
  //
  // The above copyright notice and this permission notice shall be included in
  // all copies or substantial portions of the Software.
  //
  // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  // THE SOFTWARE.
  
  // Purpose: include this in your module to avoids adding dependencies on
  // micro modules like 'global' and 'is-browser';
  
  // @ts-nocheck
  /* eslint-disable no-restricted-globals */
  /* global process, window, global, document, self, importScripts */
  const globals = {
    self: typeof self !== 'undefined' && self,
    window: typeof window !== 'undefined' && window,
    global: typeof global !== 'undefined' && global,
    document: typeof document !== 'undefined' && document
  };
  
  const self_ = globals.self || globals.window || globals.global;
  const window_ = globals.window || globals.self || globals.global;
  const global_ = globals.global || globals.self || globals.window;
  const document_ = globals.document || {};
  
  
  
  const isBrowser =
    typeof process !== 'object' || String(process) !== '[object process]' || process.browser;
  
  const isWorker = typeof importScripts === 'function';
  
  // Extract node major version
  const matches =
    typeof process !== 'undefined' && process.version && process.version.match(/v([0-9]*)/);
  const nodeVersion = (matches && parseFloat(matches[1])) || 0;
  
  /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../node_modules/webpack/buildin/global.js */ "../../node_modules/webpack/buildin/global.js"), __webpack_require__(/*! ./../../../../../node_modules/process/browser.js */ "../../node_modules/process/browser.js")))
  
  /***/ }),
  
  /***/ "../loader-utils/src/lib/library-utils/library-utils.js":
  /*!**************************************************************!*\
    !*** ../loader-utils/src/lib/library-utils/library-utils.js ***!
    \**************************************************************/
  /*! exports provided: loadLibrary, getLibraryUrl */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "loadLibrary", function() { return loadLibrary; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLibraryUrl", function() { return getLibraryUrl; });
  /* harmony import */ var _env_utils_globals__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../env-utils/globals */ "../loader-utils/src/lib/env-utils/globals.js");
  /* harmony import */ var _require_utils_node__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./require-utils.node */ 0);
  /* harmony import */ var _require_utils_node__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_require_utils_node__WEBPACK_IMPORTED_MODULE_1__);
  /* harmony import */ var _env_utils_assert__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../env-utils/assert */ "../loader-utils/src/lib/env-utils/assert.js");
  // __VERSION__ is injected by babel-plugin-version-inline
  /* global __VERSION__ */
  /* global fetch, document */
  
  
  
  
  // TODO - unpkg.com doesn't seem to have a `latest` specifier for alpha releases...
  const LATEST = 'beta';
  
  // @ts-ignore TS2304: Cannot find name '__VERSION__'.
  const VERSION =  true ? "2.1.6" : undefined;
  
  const loadLibraryPromises = {}; // promises
  
  // Dynamically loads a library ("module")
  // wasm library: Array buffer is returned
  // js library: Parse JS is returned
  //  browser - script element is created and installed on document
  //  worker - eval is called on global context
  //  node - file is required
  async function loadLibrary(libraryUrl, moduleName = null, options = {}) {
    if (moduleName) {
      libraryUrl = getLibraryUrl(libraryUrl, moduleName, options);
    }
  
    // Ensure libraries are only loaded once
    loadLibraryPromises[libraryUrl] =
      loadLibraryPromises[libraryUrl] || loadLibraryFromFile(libraryUrl);
    return await loadLibraryPromises[libraryUrl];
  }
  
  // TODO - sort out how to resolve paths for main/worker and dev/prod
  function getLibraryUrl(library, moduleName, options) {
    // Allow application to import and supply libraries through `options.modules`
    const modules = options.modules || {};
    if (modules[library]) {
      return modules[library];
    }
  
    // Load from local files, not from CDN scripts in Node.js
    // TODO - needs to locate the modules directory when installed!
    if (!_env_utils_globals__WEBPACK_IMPORTED_MODULE_0__["isBrowser"]) {
      return `modules/${moduleName}/dist/libs/${library}`;
    }
  
    // In browser, load from external scripts
    if (options.CDN) {
      Object(_env_utils_assert__WEBPACK_IMPORTED_MODULE_2__["default"])(options.CDN.startsWith('http'));
      return `${options.CDN}/${moduleName}@${VERSION}/dist/libs/${library}`;
    }
  
    // TODO - loading inside workers requires paths relative to worker script location...
    if (_env_utils_globals__WEBPACK_IMPORTED_MODULE_0__["isWorker"]) {
      return `../src/libs/${library}`;
    }
  
    return `modules/${moduleName}/src/libs/${library}`;
  }
  
  async function loadLibraryFromFile(libraryUrl) {
    if (libraryUrl.endsWith('wasm')) {
      const response = await fetch(libraryUrl);
      return await response.arrayBuffer();
    }
  
    if (!_env_utils_globals__WEBPACK_IMPORTED_MODULE_0__["isBrowser"]) {
      return Object(_require_utils_node__WEBPACK_IMPORTED_MODULE_1__["requireFromFile"])(libraryUrl);
    }
    if (_env_utils_globals__WEBPACK_IMPORTED_MODULE_0__["isWorker"]) {
      /* global importScripts */
      return importScripts(libraryUrl);
    }
    // TODO - fix - should be more secure than string parsing since observes CORS
    // if (isBrowser) {
    //   return await loadScriptFromFile(libraryUrl);
    // }
  
    const response = await fetch(libraryUrl);
    const scriptSource = await response.text();
    return loadLibraryFromString(scriptSource, libraryUrl);
  }
  
  /*
  async function loadScriptFromFile(libraryUrl) {
    const script = document.createElement('script');
    script.src = libraryUrl;
    return await new Promise((resolve, reject) => {
      script.onload = data => {
        resolve(data);
      };
      script.onerror = reject;
    });
  }
  */
  
  // TODO - Needs security audit...
  //  - Raw eval call
  //  - Potentially bypasses CORS
  // Upside is that this separates fetching and parsing
  // we could create a`LibraryLoader` or`ModuleLoader`
  function loadLibraryFromString(scriptSource, id) {
    if (!_env_utils_globals__WEBPACK_IMPORTED_MODULE_0__["isBrowser"]) {
      return Object(_require_utils_node__WEBPACK_IMPORTED_MODULE_1__["requireFromString"])(scriptSource, id);
    }
  
    if (_env_utils_globals__WEBPACK_IMPORTED_MODULE_0__["isWorker"]) {
      // Use lvalue trick to make eval run in global scope
      eval.call(_env_utils_globals__WEBPACK_IMPORTED_MODULE_0__["global"], scriptSource); // eslint-disable-line no-eval
      // https://stackoverflow.com/questions/9107240/1-evalthis-vs-evalthis-in-javascript
      // http://perfectionkills.com/global-eval-what-are-the-options/
      return null;
    }
  
    const script = document.createElement('script');
    script.id = id;
    // most browsers like a separate text node but some throw an error. The second method covers those.
    try {
      script.appendChild(document.createTextNode(scriptSource));
    } catch (e) {
      script.text = scriptSource;
    }
    document.body.appendChild(script);
    return null;
  }
  
  // TODO - technique for module injection into worker, from THREE.DracoLoader...
  /*
  function combineWorkerWithLibrary(worker, jsContent) {
    var fn = wWorker.toString();
    var body = [
      '// injected',
      jsContent,
      '',
      '// worker',
      fn.substring(fn.indexOf('{') + 1, fn.lastIndexOf('}'))
    ].join('\n');
    this.workerSourceURL = URL.createObjectURL(new Blob([body]));
  }
  */
  
  
  /***/ }),
  
  /***/ "../loader-utils/src/lib/parser-utils/parse-json.js":
  /*!**********************************************************!*\
    !*** ../loader-utils/src/lib/parser-utils/parse-json.js ***!
    \**********************************************************/
  /*! exports provided: parseJSON */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseJSON", function() { return parseJSON; });
  /* harmony import */ var _binary_utils_get_first_characters__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../binary-utils/get-first-characters */ "../loader-utils/src/lib/binary-utils/get-first-characters.js");
  
  
  // Minimal JSON parser with a meaningful error message
  function parseJSON(string) {
    try {
      return JSON.parse(string);
    } catch (_) {
      throw new Error(`Failed to parse JSON from data starting with "${Object(_binary_utils_get_first_characters__WEBPACK_IMPORTED_MODULE_0__["getFirstCharacters"])(string)}"`);
    }
  }
  
  
  /***/ }),
  
  /***/ "../loader-utils/src/lib/path-utils/file-aliases.js":
  /*!**********************************************************!*\
    !*** ../loader-utils/src/lib/path-utils/file-aliases.js ***!
    \**********************************************************/
  /*! exports provided: setPathPrefix, getPathPrefix, addAliases, resolvePath */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setPathPrefix", function() { return setPathPrefix; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getPathPrefix", function() { return getPathPrefix; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addAliases", function() { return addAliases; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "resolvePath", function() { return resolvePath; });
  // Simple file alias mechanisms for tests.
  
  let pathPrefix = '';
  const fileAliases = {};
  
  /*
   * Set a relative path prefix
   */
  function setPathPrefix(prefix) {
    pathPrefix = prefix;
  }
  
  function getPathPrefix() {
    return pathPrefix;
  }
  
  // Note: addAliases are an experimental export,
  // they are only for testing of loaders.gl loaders
  // not inteded as a generic aliasing mechanism
  function addAliases(aliases) {
    Object.assign(fileAliases, aliases);
  }
  
  function resolvePath(filename) {
    for (const alias in fileAliases) {
      if (filename.startsWith(alias)) {
        const replacement = fileAliases[alias];
        filename = filename.replace(alias, replacement);
      }
    }
    if (!filename.startsWith('http://') && !filename.startsWith('https://')) {
      filename = `${pathPrefix}${filename}`;
    }
    return filename;
  }
  
  
  /***/ }),
  
  /***/ "../loader-utils/src/lib/path-utils/path.js":
  /*!**************************************************!*\
    !*** ../loader-utils/src/lib/path-utils/path.js ***!
    \**************************************************/
  /*! exports provided: dirname */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dirname", function() { return dirname; });
  // Beginning of a minimal implementation of the Node.js path API, that doesn't pull in big polyfills.
  function dirname(url) {
    const slashIndex = url && url.lastIndexOf('/');
    return slashIndex >= 0 ? url.substr(0, slashIndex) : '';
  }
  
  
  /***/ }),
  
  /***/ "../loader-utils/src/lib/request-utils/request-scheduler.js":
  /*!******************************************************************!*\
    !*** ../loader-utils/src/lib/request-utils/request-scheduler.js ***!
    \******************************************************************/
  /*! exports provided: default */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return RequestScheduler; });
  /* harmony import */ var _probe_gl_stats__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @probe.gl/stats */ "../../node_modules/@probe.gl/stats/dist/esm/index.js");
  // TODO - this should move to core when test cases are more complete
  
  /* global setTimeout */
  
  
  const STAT_QUEUED_REQUESTS = 'Queued Requests';
  const STAT_ACTIVE_REQUESTS = 'Active Requests';
  const STAT_CANCELLED_REQUESTS = 'Cancelled Requests';
  const STAT_QUEUED_REQUESTS_EVER = 'Queued Requests Ever';
  const STAT_ACTIVE_REQUESTS_EVER = 'Active Requests Ever';
  
  const DEFAULT_PROPS = {
    id: 'request-scheduler',
    // Specifies if the request scheduler should throttle incoming requests, mainly for comparative testing
    throttleRequests: true,
    // The maximum number of simultaneous active requests. Un-throttled requests do not observe this limit.
    maxRequests: 6
  };
  
  // The request scheduler does not actually issue requests, it just lets apps know
  // when the request can be issued without overwhelming the server.
  // The main use case is to let the app reprioritize or cancel requests if
  //  circumstances change before the request can be scheduled.
  //
  // TODO - Track requests globally, across multiple servers
  class RequestScheduler {
    constructor(props = {}) {
      this.props = {...DEFAULT_PROPS, ...props};
  
      // Tracks the number of active requests and prioritizes/cancels queued requests.
      this.requestQueue = [];
      this.activeRequestCount = 0;
      this.requestMap = {};
  
      // Returns the statistics used by the request scheduler.
      this.stats = new _probe_gl_stats__WEBPACK_IMPORTED_MODULE_0__["Stats"]({id: props.id});
      this.stats.get(STAT_QUEUED_REQUESTS);
      this.stats.get(STAT_ACTIVE_REQUESTS);
      this.stats.get(STAT_CANCELLED_REQUESTS);
      this.stats.get(STAT_QUEUED_REQUESTS_EVER);
      this.stats.get(STAT_ACTIVE_REQUESTS_EVER);
  
      this._deferredUpdate = null;
    }
  
    // Called by an application that wants to issue a request, without having it deeply queued
    // Parameter `callback` will be called when request "slots" open up,
    //    allowing the caller to update priority or cancel the request
    //    Highest priority executes first, priority < 0 cancels the request
    // Returns: a promise that resolves when the request can be issued without queueing,
    //    or rejects if the request has been cancelled (by the callback)
    scheduleRequest(handle, callback = () => 0) {
      // Allows throttling to be disabled
      if (!this.props.throttleRequests) {
        return Promise.resolve(handle);
      }
  
      // dedupe
      if (this.requestMap[handle.id]) {
        return this.requestMap[handle.id];
      }
  
      let request = null;
      const promise = new Promise((resolve, reject) => {
        request = {handle, callback, resolve, reject};
        return request;
      });
  
      // TODO - error, request is not defined?
      // @ts-ignore
      this.requestQueue.push({promise, ...request});
      this.requestMap[handle.id] = promise;
      this._issueNewRequests();
      return promise;
    }
  
    // Called by an application to mark that it is actively making a request
    startRequest(handle) {
      this.activeRequestCount++;
    }
  
    // Called by an application to mark that it is finished making a request
    endRequest(handle) {
      if (this.requestMap[handle.id]) {
        delete this.requestMap[handle.id];
      }
      this.activeRequestCount--;
      this._issueNewRequests();
    }
  
    // Tracks a request promise, starting and then ending the request (triggering new slots).
    trackRequestPromise(handle, promise) {
      this.startRequest(handle);
      promise.then(() => this.endRequest(handle)).catch(() => this.endRequest(handle));
    }
  
    // PRIVATE
  
    // debounce request updates, to prevent duplicate updates in the same tick
    _issueNewRequests() {
      if (!this._deferredUpdate) {
        this._deferredUpdate = setTimeout(() => this._issueNewRequestsAsync(), 0);
      }
    }
  
    // Refresh all requests and
    _issueNewRequestsAsync() {
      this._deferredUpdate = null;
  
      const freeSlots = Math.max(this.props.maxRequests - this.activeRequestCount, 0);
  
      if (freeSlots === 0) {
        return;
      }
  
      this._updateAllRequests();
  
      // Resolve pending promises for the top-priority requests
      for (let i = 0; i < freeSlots; ++i) {
        if (this.requestQueue.length > 0) {
          const request = this.requestQueue.shift();
          request.resolve(true);
        }
      }
  
      // Uncomment to debug
      // console.log(`${freeSlots} free slots, ${this.requestQueue.length} queued requests`);
    }
  
    // Ensure all requests have updated priorities, and that no longer valid requests are cancelled
    _updateAllRequests() {
      const requestQueue = this.requestQueue;
      for (let i = 0; i < requestQueue.length; ++i) {
        const request = requestQueue[i];
        if (!this._updateRequest(request)) {
          // Remove the element and make sure to adjust the counter to account for shortened array
          requestQueue.splice(i, 1);
          delete this.requestMap[request.handle.id];
          i--;
        }
      }
  
      // Sort the remaining requests based on priority
      requestQueue.sort((a, b) => a.priority - b.priority);
    }
  
    // Update a single request by calling the callback
    _updateRequest(request) {
      request.priority = request.callback(request.handle); // eslint-disable-line callback-return
  
      // by returning a negative priority, the callback cancels the request
      if (request.priority < 0) {
        request.resolve(false);
        return false;
      }
      return true;
    }
  }
  
  
  /***/ }),
  
  /***/ "../loader-utils/src/lib/validate-loader-version.js":
  /*!**********************************************************!*\
    !*** ../loader-utils/src/lib/validate-loader-version.js ***!
    \**********************************************************/
  /*! exports provided: validateLoaderVersion */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "validateLoaderVersion", function() { return validateLoaderVersion; });
  /* harmony import */ var _env_utils_assert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./env-utils/assert */ "../loader-utils/src/lib/env-utils/assert.js");
  
  
  // __VERSION__ is injected by babel-plugin-version-inline
  /* global __VERSION__ */
  // @ts-ignore TS2304: Cannot find name '__VERSION__'.
  const VERSION =  true ? "2.1.6" : undefined;
  
  // Returns `true` if the two versions are compatible
  function validateLoaderVersion(loader, coreVersion = VERSION) {
    Object(_env_utils_assert__WEBPACK_IMPORTED_MODULE_0__["default"])(loader, 'no loader provided');
  
    let loaderVersion = loader.version;
    if (!coreVersion || !loaderVersion) {
      return;
    }
  
    coreVersion = parseVersion(coreVersion);
    loaderVersion = parseVersion(loaderVersion);
  
    // TODO enable when fix the __version__ injection
    // assert(
    //   coreVersion.major === loaderVersion.major && coreVersion.minor <= loaderVersion.minor,
    //   `loader: ${loader.name} is not compatible. ${coreVersion.major}.${
    //     coreVersion.minor
    //   }+ is required.`
    // );
  }
  
  function parseVersion(version) {
    const parts = version.split('.').map(Number);
    return {major: parts[0], minor: parts[1]};
  }
  
  
  /***/ }),
  
  /***/ "../loader-utils/src/lib/worker-utils/get-transfer-list.js":
  /*!*****************************************************************!*\
    !*** ../loader-utils/src/lib/worker-utils/get-transfer-list.js ***!
    \*****************************************************************/
  /*! exports provided: getTransferList */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTransferList", function() { return getTransferList; });
  // NOTE - there is a copy of this function is both in core and loader-utils
  // core does not need all the utils in loader-utils, just this one.
  
  /* global MessagePort, ImageBitmap, OffscreenCanvas */
  
  // Returns an array of Transferrable objects that can be used with postMessage
  // https://developer.mozilla.org/en-US/docs/Web/API/Worker/postMessage
  function getTransferList(object, recursive = true, transfers) {
    // Make sure that items in the transfer list is unique
    const transfersSet = transfers || new Set();
  
    if (!object) {
      // ignore
    } else if (isTransferable(object)) {
      transfersSet.add(object);
    } else if (isTransferable(object.buffer)) {
      // Typed array
      transfersSet.add(object.buffer);
    } else if (recursive && typeof object === 'object') {
      for (const key in object) {
        // Avoid perf hit - only go one level deep
        getTransferList(object[key], recursive, transfersSet);
      }
    }
  
    // If transfers is defined, is internal recursive call
    // Otherwise it's called by the user
    return transfers === undefined ? Array.from(transfersSet) : null;
  }
  
  // https://developer.mozilla.org/en-US/docs/Web/API/Transferable
  function isTransferable(object) {
    if (!object) {
      return false;
    }
    if (object instanceof ArrayBuffer) {
      return true;
    }
    if (typeof MessagePort !== 'undefined' && object instanceof MessagePort) {
      return true;
    }
    if (typeof ImageBitmap !== 'undefined' && object instanceof ImageBitmap) {
      return true;
    }
    if (typeof OffscreenCanvas !== 'undefined' && object instanceof OffscreenCanvas) {
      return true;
    }
    return false;
  }
  
  
  /***/ }),
  
  /***/ "./node_modules/@math.gl/geospatial/dist/esm/constants.js":
  /*!****************************************************************!*\
    !*** ./node_modules/@math.gl/geospatial/dist/esm/constants.js ***!
    \****************************************************************/
  /*! exports provided: WGS84_RADIUS_X, WGS84_RADIUS_Y, WGS84_RADIUS_Z, WGS84_CONSTANTS */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WGS84_RADIUS_X", function() { return WGS84_RADIUS_X; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WGS84_RADIUS_Y", function() { return WGS84_RADIUS_Y; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WGS84_RADIUS_Z", function() { return WGS84_RADIUS_Z; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WGS84_CONSTANTS", function() { return WGS84_CONSTANTS; });
  var WGS84_RADIUS_X = 6378137.0;
  var WGS84_RADIUS_Y = 6378137.0;
  var WGS84_RADIUS_Z = 6356752.3142451793;
  var WGS84_CONSTANTS = {
    radii: [WGS84_RADIUS_X, WGS84_RADIUS_Y, WGS84_RADIUS_Z],
    radiiSquared: [WGS84_RADIUS_X * WGS84_RADIUS_X, WGS84_RADIUS_Y * WGS84_RADIUS_Y, WGS84_RADIUS_Z * WGS84_RADIUS_Z],
    oneOverRadii: [1.0 / WGS84_RADIUS_X, 1.0 / WGS84_RADIUS_Y, 1.0 / WGS84_RADIUS_Z],
    oneOverRadiiSquared: [1.0 / (WGS84_RADIUS_X * WGS84_RADIUS_X), 1.0 / (WGS84_RADIUS_Y * WGS84_RADIUS_Y), 1.0 / (WGS84_RADIUS_Z * WGS84_RADIUS_Z)],
    maximumRadius: Math.max(WGS84_RADIUS_X, WGS84_RADIUS_Y, WGS84_RADIUS_Z),
    centerToleranceSquared: 1e-1
  };
  //# sourceMappingURL=constants.js.map
  
  /***/ }),
  
  /***/ "./node_modules/@math.gl/geospatial/dist/esm/ellipsoid/ellipsoid.js":
  /*!**************************************************************************!*\
    !*** ./node_modules/@math.gl/geospatial/dist/esm/ellipsoid/ellipsoid.js ***!
    \**************************************************************************/
  /*! exports provided: default */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Ellipsoid; });
  /* harmony import */ var _babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/slicedToArray */ "../../node_modules/@babel/runtime/helpers/esm/slicedToArray.js");
  /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "../../node_modules/@babel/runtime/helpers/esm/classCallCheck.js");
  /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "../../node_modules/@babel/runtime/helpers/esm/createClass.js");
  /* harmony import */ var math_gl__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! math.gl */ "../../node_modules/math.gl/dist/esm/index.js");
  /* harmony import */ var gl_matrix_vec3__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! gl-matrix/vec3 */ "../../node_modules/gl-matrix/esm/vec3.js");
  /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../constants */ "./node_modules/@math.gl/geospatial/dist/esm/constants.js");
  /* harmony import */ var _type_utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../type-utils */ "./node_modules/@math.gl/geospatial/dist/esm/type-utils.js");
  /* harmony import */ var _helpers_scale_to_geodetic_surface__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./helpers/scale-to-geodetic-surface */ "./node_modules/@math.gl/geospatial/dist/esm/ellipsoid/helpers/scale-to-geodetic-surface.js");
  /* harmony import */ var _helpers_ellipsoid_transform__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./helpers/ellipsoid-transform */ "./node_modules/@math.gl/geospatial/dist/esm/ellipsoid/helpers/ellipsoid-transform.js");
  
  
  
  
  
  
  
  
  
  var scratchVector = new math_gl__WEBPACK_IMPORTED_MODULE_3__["Vector3"]();
  var scratchNormal = new math_gl__WEBPACK_IMPORTED_MODULE_3__["Vector3"]();
  var scratchK = new math_gl__WEBPACK_IMPORTED_MODULE_3__["Vector3"]();
  var scratchPosition = new math_gl__WEBPACK_IMPORTED_MODULE_3__["Vector3"]();
  var scratchHeight = new math_gl__WEBPACK_IMPORTED_MODULE_3__["Vector3"]();
  var scratchCartesian = new math_gl__WEBPACK_IMPORTED_MODULE_3__["Vector3"]();
  var wgs84;
  
  var Ellipsoid = function () {
    Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__["default"])(Ellipsoid, null, [{
      key: "WGS84",
      get: function get() {
        wgs84 = wgs84 || new Ellipsoid(_constants__WEBPACK_IMPORTED_MODULE_5__["WGS84_RADIUS_X"], _constants__WEBPACK_IMPORTED_MODULE_5__["WGS84_RADIUS_Y"], _constants__WEBPACK_IMPORTED_MODULE_5__["WGS84_RADIUS_Z"]);
        return wgs84;
      }
    }]);
  
    function Ellipsoid() {
      var x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0.0;
      var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0.0;
      var z = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0.0;
  
      Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__["default"])(this, Ellipsoid);
  
      Object(math_gl__WEBPACK_IMPORTED_MODULE_3__["assert"])(x >= 0.0);
      Object(math_gl__WEBPACK_IMPORTED_MODULE_3__["assert"])(y >= 0.0);
      Object(math_gl__WEBPACK_IMPORTED_MODULE_3__["assert"])(z >= 0.0);
      this.radii = new math_gl__WEBPACK_IMPORTED_MODULE_3__["Vector3"](x, y, z);
      this.radiiSquared = new math_gl__WEBPACK_IMPORTED_MODULE_3__["Vector3"](x * x, y * y, z * z);
      this.radiiToTheFourth = new math_gl__WEBPACK_IMPORTED_MODULE_3__["Vector3"](x * x * x * x, y * y * y * y, z * z * z * z);
      this.oneOverRadii = new math_gl__WEBPACK_IMPORTED_MODULE_3__["Vector3"](x === 0.0 ? 0.0 : 1.0 / x, y === 0.0 ? 0.0 : 1.0 / y, z === 0.0 ? 0.0 : 1.0 / z);
      this.oneOverRadiiSquared = new math_gl__WEBPACK_IMPORTED_MODULE_3__["Vector3"](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));
      this.minimumRadius = Math.min(x, y, z);
      this.maximumRadius = Math.max(x, y, z);
      this.centerToleranceSquared = math_gl__WEBPACK_IMPORTED_MODULE_3__["_MathUtils"].EPSILON1;
  
      if (this.radiiSquared.z !== 0) {
        this.squaredXOverSquaredZ = this.radiiSquared.x / this.radiiSquared.z;
      }
  
      Object.freeze(this);
    }
  
    Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__["default"])(Ellipsoid, [{
      key: "equals",
      value: function equals(right) {
        return this === right || Boolean(right && this.radii.equals(right.radii));
      }
    }, {
      key: "toString",
      value: function toString() {
        return this.radii.toString();
      }
    }, {
      key: "cartographicToCartesian",
      value: function cartographicToCartesian(cartographic) {
        var result = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [0, 0, 0];
        var normal = scratchNormal;
        var k = scratchK;
  
        var _cartographic = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__["default"])(cartographic, 3),
            height = _cartographic[2];
  
        this.geodeticSurfaceNormalCartographic(cartographic, normal);
        k.copy(this.radiiSquared).scale(normal);
        var gamma = Math.sqrt(normal.dot(k));
        k.scale(1 / gamma);
        normal.scale(height);
        k.add(normal);
        return k.to(result);
      }
    }, {
      key: "cartesianToCartographic",
      value: function cartesianToCartographic(cartesian) {
        var result = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [0, 0, 0];
        scratchCartesian.from(cartesian);
        var point = this.scaleToGeodeticSurface(scratchCartesian, scratchPosition);
  
        if (!point) {
          return undefined;
        }
  
        var normal = this.geodeticSurfaceNormal(point, scratchNormal);
        var h = scratchHeight;
        h.copy(scratchCartesian).subtract(point);
        var longitude = Math.atan2(normal.y, normal.x);
        var latitude = Math.asin(normal.z);
        var height = Math.sign(gl_matrix_vec3__WEBPACK_IMPORTED_MODULE_4__["dot"](h, scratchCartesian)) * gl_matrix_vec3__WEBPACK_IMPORTED_MODULE_4__["length"](h);
        return Object(_type_utils__WEBPACK_IMPORTED_MODULE_6__["toCartographicFromRadians"])([longitude, latitude, height], result);
      }
    }, {
      key: "eastNorthUpToFixedFrame",
      value: function eastNorthUpToFixedFrame(origin) {
        var result = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : new math_gl__WEBPACK_IMPORTED_MODULE_3__["Matrix4"]();
        return Object(_helpers_ellipsoid_transform__WEBPACK_IMPORTED_MODULE_8__["default"])(this, 'east', 'north', 'up', origin, result);
      }
    }, {
      key: "localFrameToFixedFrame",
      value: function localFrameToFixedFrame(firstAxis, secondAxis, thirdAxis, origin) {
        var result = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : new math_gl__WEBPACK_IMPORTED_MODULE_3__["Matrix4"]();
        return Object(_helpers_ellipsoid_transform__WEBPACK_IMPORTED_MODULE_8__["default"])(this, firstAxis, secondAxis, thirdAxis, origin, result);
      }
    }, {
      key: "geocentricSurfaceNormal",
      value: function geocentricSurfaceNormal(cartesian) {
        var result = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [0, 0, 0];
        return scratchVector.from(cartesian).normalize().to(result);
      }
    }, {
      key: "geodeticSurfaceNormalCartographic",
      value: function geodeticSurfaceNormalCartographic(cartographic) {
        var result = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [0, 0, 0];
        var cartographicVectorRadians = Object(_type_utils__WEBPACK_IMPORTED_MODULE_6__["fromCartographicToRadians"])(cartographic);
        var longitude = cartographicVectorRadians[0];
        var latitude = cartographicVectorRadians[1];
        var cosLatitude = Math.cos(latitude);
        scratchVector.set(cosLatitude * Math.cos(longitude), cosLatitude * Math.sin(longitude), Math.sin(latitude)).normalize();
        return scratchVector.to(result);
      }
    }, {
      key: "geodeticSurfaceNormal",
      value: function geodeticSurfaceNormal(cartesian) {
        var result = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [0, 0, 0];
        return scratchVector.from(cartesian).scale(this.oneOverRadiiSquared).normalize().to(result);
      }
    }, {
      key: "scaleToGeodeticSurface",
      value: function scaleToGeodeticSurface(cartesian, result) {
        return Object(_helpers_scale_to_geodetic_surface__WEBPACK_IMPORTED_MODULE_7__["default"])(cartesian, this, result);
      }
    }, {
      key: "scaleToGeocentricSurface",
      value: function scaleToGeocentricSurface(cartesian) {
        var result = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [0, 0, 0];
        scratchPosition.from(cartesian);
        var positionX = scratchPosition.x;
        var positionY = scratchPosition.y;
        var positionZ = scratchPosition.z;
        var oneOverRadiiSquared = this.oneOverRadiiSquared;
        var beta = 1.0 / Math.sqrt(positionX * positionX * oneOverRadiiSquared.x + positionY * positionY * oneOverRadiiSquared.y + positionZ * positionZ * oneOverRadiiSquared.z);
        return scratchPosition.multiplyScalar(beta).to(result);
      }
    }, {
      key: "transformPositionToScaledSpace",
      value: function transformPositionToScaledSpace(position) {
        var result = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [0, 0, 0];
        return scratchPosition.from(position).scale(this.oneOverRadii).to(result);
      }
    }, {
      key: "transformPositionFromScaledSpace",
      value: function transformPositionFromScaledSpace(position) {
        var result = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [0, 0, 0];
        return scratchPosition.from(position).scale(this.radii).to(result);
      }
    }, {
      key: "getSurfaceNormalIntersectionWithZAxis",
      value: function getSurfaceNormalIntersectionWithZAxis(position) {
        var buffer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0.0;
        var result = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [0, 0, 0];
        Object(math_gl__WEBPACK_IMPORTED_MODULE_3__["assert"])(Object(math_gl__WEBPACK_IMPORTED_MODULE_3__["equals"])(this.radii.x, this.radii.y, math_gl__WEBPACK_IMPORTED_MODULE_3__["_MathUtils"].EPSILON15));
        Object(math_gl__WEBPACK_IMPORTED_MODULE_3__["assert"])(this.radii.z > 0);
        scratchPosition.from(position);
        var z = scratchPosition.z * (1 - this.squaredXOverSquaredZ);
  
        if (Math.abs(z) >= this.radii.z - buffer) {
          return undefined;
        }
  
        return scratchPosition.set(0.0, 0.0, z).to(result);
      }
    }]);
  
    return Ellipsoid;
  }();
  
  
  //# sourceMappingURL=ellipsoid.js.map
  
  /***/ }),
  
  /***/ "./node_modules/@math.gl/geospatial/dist/esm/ellipsoid/helpers/ellipsoid-transform.js":
  /*!********************************************************************************************!*\
    !*** ./node_modules/@math.gl/geospatial/dist/esm/ellipsoid/helpers/ellipsoid-transform.js ***!
    \********************************************************************************************/
  /*! exports provided: default */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return localFrameToFixedFrame; });
  /* harmony import */ var math_gl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! math.gl */ "../../node_modules/math.gl/dist/esm/index.js");
  
  var EPSILON14 = 1e-14;
  var scratchOrigin = new math_gl__WEBPACK_IMPORTED_MODULE_0__["Vector3"]();
  var VECTOR_PRODUCT_LOCAL_FRAME = {
    up: {
      south: 'east',
      north: 'west',
      west: 'south',
      east: 'north'
    },
    down: {
      south: 'west',
      north: 'east',
      west: 'north',
      east: 'south'
    },
    south: {
      up: 'west',
      down: 'east',
      west: 'down',
      east: 'up'
    },
    north: {
      up: 'east',
      down: 'west',
      west: 'up',
      east: 'down'
    },
    west: {
      up: 'north',
      down: 'south',
      north: 'down',
      south: 'up'
    },
    east: {
      up: 'south',
      down: 'north',
      north: 'up',
      south: 'down'
    }
  };
  var degeneratePositionLocalFrame = {
    north: [-1, 0, 0],
    east: [0, 1, 0],
    up: [0, 0, 1],
    south: [1, 0, 0],
    west: [0, -1, 0],
    down: [0, 0, -1]
  };
  var scratchAxisVectors = {
    east: new math_gl__WEBPACK_IMPORTED_MODULE_0__["Vector3"](),
    north: new math_gl__WEBPACK_IMPORTED_MODULE_0__["Vector3"](),
    up: new math_gl__WEBPACK_IMPORTED_MODULE_0__["Vector3"](),
    west: new math_gl__WEBPACK_IMPORTED_MODULE_0__["Vector3"](),
    south: new math_gl__WEBPACK_IMPORTED_MODULE_0__["Vector3"](),
    down: new math_gl__WEBPACK_IMPORTED_MODULE_0__["Vector3"]()
  };
  var scratchVector1 = new math_gl__WEBPACK_IMPORTED_MODULE_0__["Vector3"]();
  var scratchVector2 = new math_gl__WEBPACK_IMPORTED_MODULE_0__["Vector3"]();
  var scratchVector3 = new math_gl__WEBPACK_IMPORTED_MODULE_0__["Vector3"]();
  function localFrameToFixedFrame(ellipsoid, firstAxis, secondAxis, thirdAxis, cartesianOrigin, result) {
    var thirdAxisInferred = VECTOR_PRODUCT_LOCAL_FRAME[firstAxis] && VECTOR_PRODUCT_LOCAL_FRAME[firstAxis][secondAxis];
    Object(math_gl__WEBPACK_IMPORTED_MODULE_0__["assert"])(thirdAxisInferred && (!thirdAxis || thirdAxis === thirdAxisInferred));
    var firstAxisVector;
    var secondAxisVector;
    var thirdAxisVector;
    var origin = scratchOrigin.copy(cartesianOrigin);
    var atPole = Object(math_gl__WEBPACK_IMPORTED_MODULE_0__["equals"])(origin.x, 0.0, EPSILON14) && Object(math_gl__WEBPACK_IMPORTED_MODULE_0__["equals"])(origin.y, 0.0, EPSILON14);
  
    if (atPole) {
      var sign = Math.sign(origin.z);
      firstAxisVector = scratchVector1.fromArray(degeneratePositionLocalFrame[firstAxis]);
  
      if (firstAxis !== 'east' && firstAxis !== 'west') {
        firstAxisVector.scale(sign);
      }
  
      secondAxisVector = scratchVector2.fromArray(degeneratePositionLocalFrame[secondAxis]);
  
      if (secondAxis !== 'east' && secondAxis !== 'west') {
        secondAxisVector.scale(sign);
      }
  
      thirdAxisVector = scratchVector3.fromArray(degeneratePositionLocalFrame[thirdAxis]);
  
      if (thirdAxis !== 'east' && thirdAxis !== 'west') {
        thirdAxisVector.scale(sign);
      }
    } else {
      var up = scratchAxisVectors.up,
          east = scratchAxisVectors.east,
          north = scratchAxisVectors.north;
      east.set(-origin.y, origin.x, 0.0).normalize();
      ellipsoid.geodeticSurfaceNormal(origin, up);
      north.copy(up).cross(east);
      var down = scratchAxisVectors.down,
          west = scratchAxisVectors.west,
          south = scratchAxisVectors.south;
      down.copy(up).scale(-1);
      west.copy(east).scale(-1);
      south.copy(north).scale(-1);
      firstAxisVector = scratchAxisVectors[firstAxis];
      secondAxisVector = scratchAxisVectors[secondAxis];
      thirdAxisVector = scratchAxisVectors[thirdAxis];
    }
  
    result[0] = firstAxisVector.x;
    result[1] = firstAxisVector.y;
    result[2] = firstAxisVector.z;
    result[3] = 0.0;
    result[4] = secondAxisVector.x;
    result[5] = secondAxisVector.y;
    result[6] = secondAxisVector.z;
    result[7] = 0.0;
    result[8] = thirdAxisVector.x;
    result[9] = thirdAxisVector.y;
    result[10] = thirdAxisVector.z;
    result[11] = 0.0;
    result[12] = origin.x;
    result[13] = origin.y;
    result[14] = origin.z;
    result[15] = 1.0;
    return result;
  }
  //# sourceMappingURL=ellipsoid-transform.js.map
  
  /***/ }),
  
  /***/ "./node_modules/@math.gl/geospatial/dist/esm/ellipsoid/helpers/scale-to-geodetic-surface.js":
  /*!**************************************************************************************************!*\
    !*** ./node_modules/@math.gl/geospatial/dist/esm/ellipsoid/helpers/scale-to-geodetic-surface.js ***!
    \**************************************************************************************************/
  /*! exports provided: default */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return scaleToGeodeticSurface; });
  /* harmony import */ var math_gl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! math.gl */ "../../node_modules/math.gl/dist/esm/index.js");
  /* harmony import */ var gl_matrix_vec3__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! gl-matrix/vec3 */ "../../node_modules/gl-matrix/esm/vec3.js");
  
  
  var scratchVector = new math_gl__WEBPACK_IMPORTED_MODULE_0__["Vector3"]();
  var scaleToGeodeticSurfaceIntersection = new math_gl__WEBPACK_IMPORTED_MODULE_0__["Vector3"]();
  var scaleToGeodeticSurfaceGradient = new math_gl__WEBPACK_IMPORTED_MODULE_0__["Vector3"]();
  function scaleToGeodeticSurface(cartesian, ellipsoid) {
    var result = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : new math_gl__WEBPACK_IMPORTED_MODULE_0__["Vector3"]();
    var oneOverRadii = ellipsoid.oneOverRadii,
        oneOverRadiiSquared = ellipsoid.oneOverRadiiSquared,
        centerToleranceSquared = ellipsoid.centerToleranceSquared;
    scratchVector.from(cartesian);
    var positionX = cartesian.x;
    var positionY = cartesian.y;
    var positionZ = cartesian.z;
    var oneOverRadiiX = oneOverRadii.x;
    var oneOverRadiiY = oneOverRadii.y;
    var oneOverRadiiZ = oneOverRadii.z;
    var x2 = positionX * positionX * oneOverRadiiX * oneOverRadiiX;
    var y2 = positionY * positionY * oneOverRadiiY * oneOverRadiiY;
    var z2 = positionZ * positionZ * oneOverRadiiZ * oneOverRadiiZ;
    var squaredNorm = x2 + y2 + z2;
    var ratio = Math.sqrt(1.0 / squaredNorm);
  
    if (!Number.isFinite(ratio)) {
      return undefined;
    }
  
    var intersection = scaleToGeodeticSurfaceIntersection;
    intersection.copy(cartesian).scale(ratio);
  
    if (squaredNorm < centerToleranceSquared) {
      return intersection.to(result);
    }
  
    var oneOverRadiiSquaredX = oneOverRadiiSquared.x;
    var oneOverRadiiSquaredY = oneOverRadiiSquared.y;
    var oneOverRadiiSquaredZ = oneOverRadiiSquared.z;
    var gradient = scaleToGeodeticSurfaceGradient;
    gradient.set(intersection.x * oneOverRadiiSquaredX * 2.0, intersection.y * oneOverRadiiSquaredY * 2.0, intersection.z * oneOverRadiiSquaredZ * 2.0);
    var lambda = (1.0 - ratio) * cartesian.len() / (0.5 * gradient.len());
    var correction = 0.0;
    var xMultiplier;
    var yMultiplier;
    var zMultiplier;
    var func;
  
    do {
      lambda -= correction;
      xMultiplier = 1.0 / (1.0 + lambda * oneOverRadiiSquaredX);
      yMultiplier = 1.0 / (1.0 + lambda * oneOverRadiiSquaredY);
      zMultiplier = 1.0 / (1.0 + lambda * oneOverRadiiSquaredZ);
      var xMultiplier2 = xMultiplier * xMultiplier;
      var yMultiplier2 = yMultiplier * yMultiplier;
      var zMultiplier2 = zMultiplier * zMultiplier;
      var xMultiplier3 = xMultiplier2 * xMultiplier;
      var yMultiplier3 = yMultiplier2 * yMultiplier;
      var zMultiplier3 = zMultiplier2 * zMultiplier;
      func = x2 * xMultiplier2 + y2 * yMultiplier2 + z2 * zMultiplier2 - 1.0;
      var denominator = x2 * xMultiplier3 * oneOverRadiiSquaredX + y2 * yMultiplier3 * oneOverRadiiSquaredY + z2 * zMultiplier3 * oneOverRadiiSquaredZ;
      var derivative = -2.0 * denominator;
      correction = func / derivative;
    } while (Math.abs(func) > math_gl__WEBPACK_IMPORTED_MODULE_0__["_MathUtils"].EPSILON12);
  
    return scratchVector.scale([xMultiplier, yMultiplier, zMultiplier]).to(result);
  }
  //# sourceMappingURL=scale-to-geodetic-surface.js.map
  
  /***/ }),
  
  /***/ "./node_modules/@math.gl/geospatial/dist/esm/index.js":
  /*!************************************************************!*\
    !*** ./node_modules/@math.gl/geospatial/dist/esm/index.js ***!
    \************************************************************/
  /*! exports provided: Ellipsoid, isWGS84 */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony import */ var _ellipsoid_ellipsoid__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ellipsoid/ellipsoid */ "./node_modules/@math.gl/geospatial/dist/esm/ellipsoid/ellipsoid.js");
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Ellipsoid", function() { return _ellipsoid_ellipsoid__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  
  /* harmony import */ var _type_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./type-utils */ "./node_modules/@math.gl/geospatial/dist/esm/type-utils.js");
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isWGS84", function() { return _type_utils__WEBPACK_IMPORTED_MODULE_1__["isWGS84"]; });
  
  
  
  //# sourceMappingURL=index.js.map
  
  /***/ }),
  
  /***/ "./node_modules/@math.gl/geospatial/dist/esm/type-utils.js":
  /*!*****************************************************************!*\
    !*** ./node_modules/@math.gl/geospatial/dist/esm/type-utils.js ***!
    \*****************************************************************/
  /*! exports provided: fromCartographic, fromCartographicToRadians, fromCartographicToDegrees, toCartographic, toCartographicFromRadians, toCartographicFromDegrees, isWGS84 */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromCartographic", function() { return fromCartographic; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromCartographicToRadians", function() { return fromCartographicToRadians; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromCartographicToDegrees", function() { return fromCartographicToDegrees; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toCartographic", function() { return toCartographic; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toCartographicFromRadians", function() { return toCartographicFromRadians; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toCartographicFromDegrees", function() { return toCartographicFromDegrees; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isWGS84", function() { return isWGS84; });
  /* harmony import */ var math_gl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! math.gl */ "../../node_modules/math.gl/dist/esm/index.js");
  /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./constants */ "./node_modules/@math.gl/geospatial/dist/esm/constants.js");
  
  
  
  var noop = function noop(x) {
    return x;
  };
  
  var scratchVector = new math_gl__WEBPACK_IMPORTED_MODULE_0__["Vector3"]();
  function fromCartographic(cartographic, vector) {
    var map = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : noop;
  
    if (Object(math_gl__WEBPACK_IMPORTED_MODULE_0__["isArray"])(cartographic)) {
      vector[0] = map(cartographic[0]);
      vector[1] = map(cartographic[1]);
      vector[2] = cartographic[2];
    } else if ('longitude' in cartographic) {
      vector[0] = map(cartographic.longitude);
      vector[1] = map(cartographic.latitude);
      vector[2] = cartographic.height;
    } else {
      vector[0] = map(cartographic.x);
      vector[1] = map(cartographic.y);
      vector[2] = cartographic.z;
    }
  
    return vector;
  }
  function fromCartographicToRadians(cartographic) {
    var vector = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : scratchVector;
    return fromCartographic(cartographic, vector, math_gl__WEBPACK_IMPORTED_MODULE_0__["config"].cartographicRadians ? noop : math_gl__WEBPACK_IMPORTED_MODULE_0__["toRadians"]);
  }
  function fromCartographicToDegrees(cartographic) {
    var vector = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : scratchVector;
    return fromCartographic(cartographic, vector, math_gl__WEBPACK_IMPORTED_MODULE_0__["config"].cartographicRadians ? math_gl__WEBPACK_IMPORTED_MODULE_0__["toDegrees"] : noop);
  }
  function toCartographic(vector, cartographic) {
    var map = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : noop;
  
    if (Object(math_gl__WEBPACK_IMPORTED_MODULE_0__["isArray"])(cartographic)) {
      cartographic[0] = map(vector[0]);
      cartographic[1] = map(vector[1]);
      cartographic[2] = vector[2];
    } else if ('longitude' in cartographic) {
      cartographic.longitude = map(vector[0]);
      cartographic.latitude = map(vector[1]);
      cartographic.height = vector[2];
    } else {
      cartographic.x = map(vector[0]);
      cartographic.y = map(vector[1]);
      cartographic.z = vector[2];
    }
  
    return cartographic;
  }
  function toCartographicFromRadians(vector, cartographic) {
    return toCartographic(vector, cartographic, math_gl__WEBPACK_IMPORTED_MODULE_0__["config"].cartographicRadians ? noop : math_gl__WEBPACK_IMPORTED_MODULE_0__["toDegrees"]);
  }
  function toCartographicFromDegrees(vector, cartographic) {
    return toCartographic(vector, cartographic, math_gl__WEBPACK_IMPORTED_MODULE_0__["config"].cartographicRadians ? math_gl__WEBPACK_IMPORTED_MODULE_0__["toRadians"] : noop);
  }
  function isWGS84(vector) {
    if (!vector) {
      return false;
    }
  
    scratchVector.from(vector);
    var oneOverRadiiSquared = _constants__WEBPACK_IMPORTED_MODULE_1__["WGS84_CONSTANTS"].oneOverRadiiSquared,
        centerToleranceSquared = _constants__WEBPACK_IMPORTED_MODULE_1__["WGS84_CONSTANTS"].centerToleranceSquared;
    var x2 = vector[0] * vector[0] * oneOverRadiiSquared[0];
    var y2 = vector[1] * vector[1] * oneOverRadiiSquared[1];
    var z2 = vector[2] * vector[2] * oneOverRadiiSquared[2];
    return Math.abs(x2 + y2 + z2 - 1) < centerToleranceSquared;
  }
  //# sourceMappingURL=type-utils.js.map
  
  /***/ }),
  
  /***/ "./src/bundle.js":
  /*!***********************!*\
    !*** ./src/bundle.js ***!
    \***********************/
  /*! no static exports found */
  /***/ (function(module, exports, __webpack_require__) {
  
  /* WEBPACK VAR INJECTION */(function(global) {/* global window, global */
  const moduleExports = __webpack_require__(/*! ./index */ "./src/index.js");
  const _global = typeof window === 'undefined' ? global : window;
  // @ts-ignore
  _global.loaders = _global.loaders || {};
  // @ts-ignore
  module.exports = Object.assign(_global.loaders, moduleExports);
  
  /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../node_modules/webpack/buildin/global.js */ "../../node_modules/webpack/buildin/global.js")))
  
  /***/ }),
  
  /***/ "./src/constants.js":
  /*!**************************!*\
    !*** ./src/constants.js ***!
    \**************************/
  /*! exports provided: TILE_CONTENT_STATE, TILE_REFINEMENT, TILE_TYPE, TILESET_TYPE, LOD_METRIC_TYPE, TILE3D_OPTIMIZATION_HINT */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TILE_CONTENT_STATE", function() { return TILE_CONTENT_STATE; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TILE_REFINEMENT", function() { return TILE_REFINEMENT; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TILE_TYPE", function() { return TILE_TYPE; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TILESET_TYPE", function() { return TILESET_TYPE; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LOD_METRIC_TYPE", function() { return LOD_METRIC_TYPE; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TILE3D_OPTIMIZATION_HINT", function() { return TILE3D_OPTIMIZATION_HINT; });
  const TILE_CONTENT_STATE = {
    UNLOADED: 0, // Has never been requested
    LOADING: 1, // Is waiting on a pending request
    PROCESSING: 2, // Request received.  Contents are being processed for rendering.  Depending on the content, it might make its own requests for external data.
    READY: 3, // Ready to render.
    EXPIRED: 4, // Is expired and will be unloaded once new content is loaded.
    FAILED: 5 // Request failed.
  };
  
  const TILE_REFINEMENT = {
    ADD: 1, // Render tile and, if screen space error exceeded, also refine to its children.
    REPLACE: 2 // Render tile or, if screen space error exceeded, refine to its descendants instead.
  };
  
  const TILE_TYPE = {
    EMPTY: 'empty',
    SCENEGRAPH: 'scenegraph',
    POINTCLOUD: 'pointcloud',
    MESH: 'mesh'
  };
  
  const TILESET_TYPE = {
    I3S: 'I3S',
    TILES3D: 'TILES3D'
  };
  
  const LOD_METRIC_TYPE = {
    GEOMETRIC_ERROR: 'geometricError',
    MAX_SCREEN_THRESHOLD: 'maxScreenThreshold'
  };
  
  // Cesium 3D Tiles Specific
  const TILE3D_OPTIMIZATION_HINT = {
    NOT_COMPUTED: -1,
    USE_OPTIMIZATION: 1,
    SKIP_OPTIMIZATION: 0
  };
  
  
  /***/ }),
  
  /***/ "./src/index.js":
  /*!**********************!*\
    !*** ./src/index.js ***!
    \**********************/
  /*! exports provided: Tileset3D, Tile3D, TilesetTraverser, TilesetCache, createBoundingVolume, calculateTransformProps, getFrameState, TILE_CONTENT_STATE, TILE_REFINEMENT, TILE_TYPE, TILESET_TYPE, LOD_METRIC_TYPE */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony import */ var _tileset_tileset_3d__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./tileset/tileset-3d */ "./src/tileset/tileset-3d.js");
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Tileset3D", function() { return _tileset_tileset_3d__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  
  /* harmony import */ var _tileset_tile_3d__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./tileset/tile-3d */ "./src/tileset/tile-3d.js");
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Tile3D", function() { return _tileset_tile_3d__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  
  /* harmony import */ var _tileset_traversers_tileset_traverser__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./tileset/traversers/tileset-traverser */ "./src/tileset/traversers/tileset-traverser.js");
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TilesetTraverser", function() { return _tileset_traversers_tileset_traverser__WEBPACK_IMPORTED_MODULE_2__["default"]; });
  
  /* harmony import */ var _tileset_tileset_cache__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./tileset/tileset-cache */ "./src/tileset/tileset-cache.js");
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TilesetCache", function() { return _tileset_tileset_cache__WEBPACK_IMPORTED_MODULE_3__["default"]; });
  
  /* harmony import */ var _tileset_helpers_bounding_volume__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./tileset/helpers/bounding-volume */ "./src/tileset/helpers/bounding-volume.js");
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createBoundingVolume", function() { return _tileset_helpers_bounding_volume__WEBPACK_IMPORTED_MODULE_4__["createBoundingVolume"]; });
  
  /* harmony import */ var _tileset_helpers_transform_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./tileset/helpers/transform-utils */ "./src/tileset/helpers/transform-utils.js");
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "calculateTransformProps", function() { return _tileset_helpers_transform_utils__WEBPACK_IMPORTED_MODULE_5__["calculateTransformProps"]; });
  
  /* harmony import */ var _tileset_helpers_frame_state__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./tileset/helpers/frame-state */ "./src/tileset/helpers/frame-state.js");
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getFrameState", function() { return _tileset_helpers_frame_state__WEBPACK_IMPORTED_MODULE_6__["getFrameState"]; });
  
  /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./constants */ "./src/constants.js");
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TILE_CONTENT_STATE", function() { return _constants__WEBPACK_IMPORTED_MODULE_7__["TILE_CONTENT_STATE"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TILE_REFINEMENT", function() { return _constants__WEBPACK_IMPORTED_MODULE_7__["TILE_REFINEMENT"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TILE_TYPE", function() { return _constants__WEBPACK_IMPORTED_MODULE_7__["TILE_TYPE"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TILESET_TYPE", function() { return _constants__WEBPACK_IMPORTED_MODULE_7__["TILESET_TYPE"]; });
  
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "LOD_METRIC_TYPE", function() { return _constants__WEBPACK_IMPORTED_MODULE_7__["LOD_METRIC_TYPE"]; });
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  /***/ }),
  
  /***/ "./src/tileset/helpers/bounding-volume.js":
  /*!************************************************!*\
    !*** ./src/tileset/helpers/bounding-volume.js ***!
    \************************************************/
  /*! exports provided: createBoundingVolume */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createBoundingVolume", function() { return createBoundingVolume; });
  /* harmony import */ var _math_gl_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @math.gl/core */ "../../node_modules/@math.gl/core/dist/esm/index.js");
  /* harmony import */ var _math_gl_culling__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @math.gl/culling */ "../../node_modules/@math.gl/culling/dist/esm/index.js");
  /* harmony import */ var _math_gl_geospatial__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @math.gl/geospatial */ "./node_modules/@math.gl/geospatial/dist/esm/index.js");
  /* harmony import */ var _loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @loaders.gl/loader-utils */ "../loader-utils/src/index.js");
  // This file is derived from the Cesium code base under Apache 2 license
  // See LICENSE.md and https://github.com/AnalyticalGraphicsInc/cesium/blob/master/LICENSE.md
  
  /* eslint-disable */
  
  
  
  
  
  // const scratchProjectedBoundingSphere = new BoundingSphere();
  
  function defined(x) {
    return x !== undefined && x !== null;
  }
  
  const scratchMatrix = new _math_gl_core__WEBPACK_IMPORTED_MODULE_0__["Matrix3"]();
  const scratchScale = new _math_gl_core__WEBPACK_IMPORTED_MODULE_0__["Vector3"]();
  const scratchNorthWest = new _math_gl_core__WEBPACK_IMPORTED_MODULE_0__["Vector3"]();
  const scratchSouthEast = new _math_gl_core__WEBPACK_IMPORTED_MODULE_0__["Vector3"]();
  // const scratchRectangle = new Rectangle();
  // const scratchOrientedBoundingBox = new OrientedBoundingBox();
  const scratchTransform = new _math_gl_core__WEBPACK_IMPORTED_MODULE_0__["Matrix4"]();
  
  /**
   * Create a bounding volume from the tile's bounding volume header.
   * @param {Object} boundingVolumeHeader The tile's bounding volume header.
   * @param {Matrix4} transform The transform to apply to the bounding volume.
   * @param {TileBoundingVolume} [result] The object onto which to store the result.
   * @returns {TileBoundingVolume} The modified result parameter or a new TileBoundingVolume instance if none was provided.
   */
  function createBoundingVolume(boundingVolumeHeader, transform, result) {
    Object(_loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_3__["assert"])(boundingVolumeHeader, '3D Tile: boundingVolume must be defined');
  
    // boundingVolume schema:
    // https://github.com/AnalyticalGraphicsInc/3d-tiles/blob/master/specification/schema/boundingVolume.schema.json
    if (boundingVolumeHeader.box) {
      return createBox(boundingVolumeHeader.box, transform, result);
    }
    if (boundingVolumeHeader.region) {
      // [west, south, east, north, minimum height, maximum height]
      // Latitudes and longitudes are in the WGS 84 datum as defined in EPSG 4979 and are in radians.
      // Heights are in meters above (or below) the WGS 84 ellipsoid.
      const [west, south, east, north, minHeight, maxHeight] = boundingVolumeHeader.region;
  
      const northWest = _math_gl_geospatial__WEBPACK_IMPORTED_MODULE_2__["Ellipsoid"].WGS84.cartographicToCartesian(
        [Object(_math_gl_core__WEBPACK_IMPORTED_MODULE_0__["degrees"])(west), Object(_math_gl_core__WEBPACK_IMPORTED_MODULE_0__["degrees"])(north), minHeight],
        scratchNorthWest
      );
      const southEast = _math_gl_geospatial__WEBPACK_IMPORTED_MODULE_2__["Ellipsoid"].WGS84.cartographicToCartesian(
        [Object(_math_gl_core__WEBPACK_IMPORTED_MODULE_0__["degrees"])(east), Object(_math_gl_core__WEBPACK_IMPORTED_MODULE_0__["degrees"])(south), maxHeight],
        scratchSouthEast
      );
      const centerInCartesian = new _math_gl_core__WEBPACK_IMPORTED_MODULE_0__["Vector3"]().addVectors(northWest, southEast).multiplyScalar(0.5);
      const radius = new _math_gl_core__WEBPACK_IMPORTED_MODULE_0__["Vector3"]().subVectors(northWest, southEast).len() / 2.0;
  
      // TODO improve region boundingVolume
      // for now, create a sphere as the boundingVolume instead of box
      return createSphere(
        [centerInCartesian[0], centerInCartesian[1], centerInCartesian[2], radius],
        new _math_gl_core__WEBPACK_IMPORTED_MODULE_0__["Matrix4"]()
      );
    }
  
    if (boundingVolumeHeader.sphere) {
      return createSphere(boundingVolumeHeader.sphere, transform, result);
    }
  
    throw new Error('3D Tile: boundingVolume must contain a sphere, region, or box');
  }
  
  function createBox(box, transform, result) {
    // box: An array of 12 numbers that define an oriented bounding box.
    // The first three elements define the x, y, and z values for the center of the box.
    // The next three elements (with indices 3, 4, and 5) define the x axis direction and half-length.
    // The next three elements (indices 6, 7, and 8) define the y axis direction and half-length.
    // The last three elements (indices 9, 10, and 11) define the z axis direction and half-length.
    const center = new _math_gl_core__WEBPACK_IMPORTED_MODULE_0__["Vector3"](box[0], box[1], box[2]);
    transform.transform(center, center);
  
    const xAxis = transform.transformAsVector(box.slice(3, 6));
    const yAxis = transform.transformAsVector(box.slice(6, 9));
    const zAxis = transform.transformAsVector(box.slice(9, 12));
    const halfAxes = new _math_gl_core__WEBPACK_IMPORTED_MODULE_0__["Matrix3"]([
      xAxis[0],
      xAxis[1],
      xAxis[2],
      yAxis[0],
      yAxis[1],
      yAxis[2],
      zAxis[0],
      zAxis[1],
      zAxis[2]
    ]);
  
    if (defined(result)) {
      result.center = center;
      result.halfAxes = halfAxes;
      return result;
    }
  
    return new _math_gl_culling__WEBPACK_IMPORTED_MODULE_1__["OrientedBoundingBox"](center, halfAxes);
  }
  
  function createBoxFromTransformedRegion(region, transform, initialTransform, result) {
    const rectangle = Rectangle.unpack(region, 0, scratchRectangle);
    const minimumHeight = region[4];
    const maximumHeight = region[5];
  
    const orientedBoundingBox = _math_gl_culling__WEBPACK_IMPORTED_MODULE_1__["OrientedBoundingBox"].fromRectangle(
      rectangle,
      minimumHeight,
      maximumHeight,
      _math_gl_geospatial__WEBPACK_IMPORTED_MODULE_2__["Ellipsoid"].WGS84,
      scratchOrientedBoundingBox
    );
    const center = orientedBoundingBox.center;
    const halfAxes = orientedBoundingBox.halfAxes;
  
    // A region bounding volume is not transformed by the transform in the tileset JSON,
    // but may be transformed by additional transforms applied in Cesium.
    // This is why the transform is calculated as the difference between the initial transform and the current transform.
    transform = _math_gl_core__WEBPACK_IMPORTED_MODULE_0__["Matrix4"].multiplyTransformation(
      transform,
      _math_gl_core__WEBPACK_IMPORTED_MODULE_0__["Matrix4"].inverseTransformation(initialTransform, scratchTransform),
      scratchTransform
    );
    center = _math_gl_core__WEBPACK_IMPORTED_MODULE_0__["Matrix4"].multiplyByPoint(transform, center, center);
    const rotationScale = _math_gl_core__WEBPACK_IMPORTED_MODULE_0__["Matrix4"].getRotation(transform, scratchMatrix);
    halfAxes = _math_gl_core__WEBPACK_IMPORTED_MODULE_0__["Matrix3"].multiply(rotationScale, halfAxes, halfAxes);
  
    if (defined(result) && result instanceof TileOrientedBoundingBox) {
      result.update(center, halfAxes);
      return result;
    }
  
    return new TileOrientedBoundingBox(center, halfAxes);
  }
  
  function createRegion(region, transform, initialTransform, result) {
    if (!_math_gl_core__WEBPACK_IMPORTED_MODULE_0__["Matrix4"].equalsEpsilon(transform, initialTransform, CesiumMath.EPSILON8)) {
      return createBoxFromTransformedRegion(region, transform, initialTransform, result);
    }
  
    if (defined(result)) {
      return result;
    }
  
    const rectangleRegion = Rectangle.unpack(region, 0, scratchRectangle);
  
    return new TileBoundingRegion({
      rectangle: rectangleRegion,
      minimumHeight: region[4],
      maximumHeight: region[5]
    });
  }
  
  function createSphere(sphere, transform, result) {
    // Find the transformed center
    const center = new _math_gl_core__WEBPACK_IMPORTED_MODULE_0__["Vector3"](sphere[0], sphere[1], sphere[2]);
    transform.transform(center, center);
    const scale = transform.getScale(scratchScale);
  
    const uniformScale = Math.max(Math.max(scale[0], scale[1]), scale[2]);
    const radius = sphere[3] * uniformScale;
  
    if (defined(result)) {
      result.center = center;
      result.radius = radius;
      return result;
    }
  
    return new _math_gl_culling__WEBPACK_IMPORTED_MODULE_1__["BoundingSphere"](center, radius);
  }
  
  
  /***/ }),
  
  /***/ "./src/tileset/helpers/frame-state.js":
  /*!********************************************!*\
    !*** ./src/tileset/helpers/frame-state.js ***!
    \********************************************/
  /*! exports provided: getFrameState */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getFrameState", function() { return getFrameState; });
  /* harmony import */ var _math_gl_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @math.gl/core */ "../../node_modules/@math.gl/core/dist/esm/index.js");
  /* harmony import */ var _math_gl_culling__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @math.gl/culling */ "../../node_modules/@math.gl/culling/dist/esm/index.js");
  /* harmony import */ var _math_gl_geospatial__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @math.gl/geospatial */ "./node_modules/@math.gl/geospatial/dist/esm/index.js");
  
  
  
  
  const scratchVector = new _math_gl_core__WEBPACK_IMPORTED_MODULE_0__["Vector3"]();
  const scratchPosition = new _math_gl_core__WEBPACK_IMPORTED_MODULE_0__["Vector3"]();
  const cullingVolume = new _math_gl_culling__WEBPACK_IMPORTED_MODULE_1__["CullingVolume"]([
    new _math_gl_culling__WEBPACK_IMPORTED_MODULE_1__["Plane"](),
    new _math_gl_culling__WEBPACK_IMPORTED_MODULE_1__["Plane"](),
    new _math_gl_culling__WEBPACK_IMPORTED_MODULE_1__["Plane"](),
    new _math_gl_culling__WEBPACK_IMPORTED_MODULE_1__["Plane"](),
    new _math_gl_culling__WEBPACK_IMPORTED_MODULE_1__["Plane"](),
    new _math_gl_culling__WEBPACK_IMPORTED_MODULE_1__["Plane"]()
  ]);
  
  // Extracts a frame state appropriate for tile culling from a deck.gl viewport
  // TODO - this could likely be generalized and merged back into deck.gl for other culling scenarios
  function getFrameState(viewport, frameNumber) {
    // Traverse and and request. Update _selectedTiles so that we know what to render.
    const {cameraDirection, cameraUp, height} = viewport;
    const {metersPerUnit} = viewport.distanceScales;
  
    const viewportCenterCartographic = [viewport.longitude, viewport.latitude, 0];
    // TODO - Ellipsoid.eastNorthUpToFixedFrame() breaks on raw array, create a Vector.
    // TODO - Ellipsoid.eastNorthUpToFixedFrame() takes a cartesian, is that intuitive?
    const viewportCenterCartesian = _math_gl_geospatial__WEBPACK_IMPORTED_MODULE_2__["Ellipsoid"].WGS84.cartographicToCartesian(
      viewportCenterCartographic,
      new _math_gl_core__WEBPACK_IMPORTED_MODULE_0__["Vector3"]()
    );
    const enuToFixedTransform = _math_gl_geospatial__WEBPACK_IMPORTED_MODULE_2__["Ellipsoid"].WGS84.eastNorthUpToFixedFrame(viewportCenterCartesian);
  
    const cameraPositionCartographic = viewport.unprojectPosition(viewport.cameraPosition);
    const cameraPositionCartesian = _math_gl_geospatial__WEBPACK_IMPORTED_MODULE_2__["Ellipsoid"].WGS84.cartographicToCartesian(
      cameraPositionCartographic,
      new _math_gl_core__WEBPACK_IMPORTED_MODULE_0__["Vector3"]()
    );
  
    // These should still be normalized as the transform has scale 1 (goes from meters to meters)
    const cameraDirectionCartesian = new _math_gl_core__WEBPACK_IMPORTED_MODULE_0__["Vector3"](
      enuToFixedTransform.transformAsVector(new _math_gl_core__WEBPACK_IMPORTED_MODULE_0__["Vector3"](cameraDirection).scale(metersPerUnit))
    ).normalize();
    const cameraUpCartesian = new _math_gl_core__WEBPACK_IMPORTED_MODULE_0__["Vector3"](
      enuToFixedTransform.transformAsVector(new _math_gl_core__WEBPACK_IMPORTED_MODULE_0__["Vector3"](cameraUp).scale(metersPerUnit))
    ).normalize();
  
    commonSpacePlanesToWGS84(viewport, viewportCenterCartesian);
  
    // TODO: make a file/class for frameState and document what needs to be attached to this so that traversal can function
    return {
      camera: {
        position: cameraPositionCartesian,
        direction: cameraDirectionCartesian,
        up: cameraUpCartesian
      },
      viewport,
      height,
      cullingVolume,
      frameNumber, // TODO: This can be the same between updates, what number is unique for between updates?
      sseDenominator: 1.15 // Assumes fovy = 60 degrees
    };
  }
  
  function commonSpacePlanesToWGS84(viewport, viewportCenterCartesian) {
    // Extract frustum planes based on current view.
    const frustumPlanes = viewport.getFrustumPlanes();
    let i = 0;
    for (const dir in frustumPlanes) {
      const plane = frustumPlanes[dir];
      const distanceToCenter = plane.normal.dot(viewport.center);
      scratchPosition
        .copy(plane.normal)
        .scale(plane.distance - distanceToCenter)
        .add(viewport.center);
      const cartographicPos = viewport.unprojectPosition(scratchPosition);
  
      const cartesianPos = _math_gl_geospatial__WEBPACK_IMPORTED_MODULE_2__["Ellipsoid"].WGS84.cartographicToCartesian(cartographicPos, new _math_gl_core__WEBPACK_IMPORTED_MODULE_0__["Vector3"]());
  
      cullingVolume.planes[i++].fromPointNormal(
        cartesianPos,
        // Want the normal to point into the frustum since that's what culling expects
        scratchVector.copy(viewportCenterCartesian).subtract(cartesianPos)
      );
    }
  }
  
  
  /***/ }),
  
  /***/ "./src/tileset/helpers/i3s-lod.js":
  /*!****************************************!*\
    !*** ./src/tileset/helpers/i3s-lod.js ***!
    \****************************************/
  /*! exports provided: lodJudge, getI3ScreenSize */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lodJudge", function() { return lodJudge; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getI3ScreenSize", function() { return getI3ScreenSize; });
  /* harmony import */ var _math_gl_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @math.gl/core */ "../../node_modules/@math.gl/core/dist/esm/index.js");
  
  
  const WGS84_RADIUS_X = 6378137.0;
  // use this to bias the lod switching  (1+ results in increasing the LOD quality)
  const qualityFactor = Math.PI / 2; // empirical derived bias factor
  /* eslint-disable max-statements */
  function lodJudge(tile, frameState) {
    const viewport = frameState.viewport;
    const metersPerPixel = viewport.metersPerPixel;
  
    const mbsLat = tile.header.mbs[1];
    const mbsLon = tile.header.mbs[0];
    const mbsZ = tile.header.mbs[2];
    const mbsR = tile.header.mbs[3];
  
    const {height, width, latitude, longitude} = viewport;
  
    const viewportCenter = [longitude, latitude];
    const mbsCenter = [mbsLon, mbsLat, mbsZ];
    const mbsLatProjected = [longitude, mbsLat];
    const mbsLonProjected = [mbsLon, latitude];
  
    const diagonalInMeters = Math.sqrt(height * height + width * width) * metersPerPixel[0];
    const distanceInMeters = getDistanceFromLatLon(viewportCenter, mbsCenter);
  
    const visibleHeight = height * 0.5 + mbsR / WGS84_RADIUS_X;
    const visibleWidth = width * 0.5 + mbsR / WGS84_RADIUS_X;
  
    if (distanceInMeters > diagonalInMeters + mbsR / WGS84_RADIUS_X) {
      return 'OUT';
    }
    if (getDistanceFromLatLon(viewportCenter, mbsLatProjected) > visibleHeight) {
      return 'OUT';
    }
    if (getDistanceFromLatLon(viewportCenter, mbsLonProjected) > visibleWidth) {
      return 'OUT';
    }
  
    if (tile.lodMetricValue === 0) {
      return 'DIG';
    }
  
    // For the maxScreenThreshold error metric, maxError means that you should replace the node with it's children
    // as soon as the nodes bounding sphere has a screen radius larger than maxError pixels.
    // In this sense a value of 0 means you should always load it's children,
    // or if it's a leaf node, you should always display it.
    let screenSize = getI3ScreenSize(tile, frameState); // in pixels
    screenSize *= qualityFactor;
    if (screenSize < 0.5) {
      return 'OUT';
    }
    // Hack: 1000 is a Magic number to get the correct LoD
    if (!tile.header.children || screenSize <= tile.lodMetricValue) {
      return 'DRAW';
    } else if (tile.header.children) {
      return 'DIG';
    }
    return 'OUT';
  }
  
  /* eslint-enable max-statements */
  
  function projectVertexToSphere([x, y, z]) {
    const azim = Object(_math_gl_core__WEBPACK_IMPORTED_MODULE_0__["toRadians"])(x);
    const incl = Object(_math_gl_core__WEBPACK_IMPORTED_MODULE_0__["toRadians"])(y);
    const radius = 1.0 + z / WGS84_RADIUS_X;
    const radCosInc = radius * Math.cos(incl);
    x = radCosInc * Math.cos(azim);
    y = radCosInc * Math.sin(azim);
    z = radius * Math.sin(incl);
    return [x, y, z];
  }
  
  function getDistanceFromLatLon(
    [observerLon, observerLat, observerZ = 0.0],
    [centerLon, centerLat, centerZ = 0.0]
  ) {
    const projectedCenter = projectVertexToSphere([centerLon, centerLat, centerZ]);
    const projectedObserver = projectVertexToSphere([observerLon, observerLat, observerZ]);
    const dx = projectedObserver[0] - projectedCenter[0];
    const dy = projectedObserver[1] - projectedCenter[1];
    const dz = projectedObserver[2] - projectedCenter[2];
    return dx * dx + dy * dy + dz * dz;
  }
  
  function getI3ScreenSize(tile, frameState) {
    const viewport = frameState.viewport;
    // https://stackoverflow.com/questions/21648630/radius-of-projected-sphere-in-screen-space
    const mbsLat = tile.header.mbs[1];
    const mbsLon = tile.header.mbs[0];
    const mbsZ = tile.header.mbs[2];
    const mbsR = tile.header.mbs[3];
  
    const mbsCenter = [mbsLon, mbsLat, mbsZ];
    const cameraPositionCartographic = viewport.unprojectPosition(viewport.cameraPosition);
    const dSquared = getDistanceFromLatLon(cameraPositionCartographic, mbsCenter);
    const mbsRNormalized = mbsR / WGS84_RADIUS_X;
    const d = dSquared - mbsRNormalized * mbsRNormalized;
    const fltMax = 3.4028235e38; // convert from 0x7f7fffff which is the maximum
    if (d <= 0.0) {
      return 0.5 * fltMax;
    }
    let screenSizeFactor = calculateScreenSizeFactor(tile, frameState);
    // viewport changed in deck.gl v8.0
    screenSizeFactor *= mbsRNormalized / Math.sqrt(d) / viewport.scale;
    return screenSizeFactor;
  }
  
  function calculateScreenSizeFactor(tile, frameState) {
    const {width, height, pixelProjectionMatrix} = frameState.viewport;
    const tanOfHalfVFAngle = Math.tan(
      Math.atan(
        Math.sqrt(
          1.0 / (pixelProjectionMatrix[0] * pixelProjectionMatrix[0]) +
            1.0 / (pixelProjectionMatrix[5] * pixelProjectionMatrix[5])
        )
      )
    );
  
    const screenCircleFactor = Math.sqrt(height * height + width * width) / tanOfHalfVFAngle;
  
    return screenCircleFactor;
  }
  
  
  /***/ }),
  
  /***/ "./src/tileset/helpers/tiles-3d-lod.js":
  /*!*********************************************!*\
    !*** ./src/tileset/helpers/tiles-3d-lod.js ***!
    \*********************************************/
  /*! exports provided: calculateDynamicScreenSpaceError, fog, getDynamicScreenSpaceError, getTiles3DScreenSpaceError */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "calculateDynamicScreenSpaceError", function() { return calculateDynamicScreenSpaceError; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fog", function() { return fog; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getDynamicScreenSpaceError", function() { return getDynamicScreenSpaceError; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTiles3DScreenSpaceError", function() { return getTiles3DScreenSpaceError; });
  /* harmony import */ var _math_gl_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @math.gl/core */ "../../node_modules/@math.gl/core/dist/esm/index.js");
  // This file is derived from the Cesium code base under Apache 2 license
  // See LICENSE.md and https://github.com/AnalyticalGraphicsInc/cesium/blob/master/LICENSE.md
  
  // TODO - Dynamic screen space error provides an optimization when looking at
  // tilesets from above
  
  /* eslint-disable */
  
  
  const scratchPositionNormal = new _math_gl_core__WEBPACK_IMPORTED_MODULE_0__["Vector3"]();
  const scratchCartographic = new _math_gl_core__WEBPACK_IMPORTED_MODULE_0__["Vector3"]();
  const scratchMatrix = new _math_gl_core__WEBPACK_IMPORTED_MODULE_0__["Matrix4"]();
  const scratchCenter = new _math_gl_core__WEBPACK_IMPORTED_MODULE_0__["Vector3"]();
  const scratchPosition = new _math_gl_core__WEBPACK_IMPORTED_MODULE_0__["Vector3"]();
  const scratchDirection = new _math_gl_core__WEBPACK_IMPORTED_MODULE_0__["Vector3"]();
  
  // eslint-disable-next-line max-statements, complexity
  function calculateDynamicScreenSpaceError(root, {camera, mapProjection}, options = {}) {
    const {
      dynamicScreenSpaceErrorHeightFalloff = 0.25,
      dynamicScreenSpaceErrorDensity = 0.00278
    } = options;
  
    let up;
    let direction;
    let height;
    let minimumHeight;
    let maximumHeight;
  
    const tileBoundingVolume = root.contentBoundingVolume;
  
    if (tileBoundingVolume instanceof TileBoundingRegion) {
      up = Cartesian3.normalize(camera.positionWC, scratchPositionNormal);
      direction = camera.directionWC;
      height = camera.positionCartographic.height;
      minimumHeight = tileBoundingVolume.minimumHeight;
      maximumHeight = tileBoundingVolume.maximumHeight;
    } else {
      // Transform camera position and direction into the local coordinate system of the tileset
      const transformLocal = _math_gl_core__WEBPACK_IMPORTED_MODULE_0__["Matrix4"].inverseTransformation(root.computedTransform, scratchMatrix);
      const ellipsoid = mapProjection.ellipsoid;
      const boundingVolume = tileBoundingVolume.boundingVolume;
      const centerLocal = _math_gl_core__WEBPACK_IMPORTED_MODULE_0__["Matrix4"].multiplyByPoint(
        transformLocal,
        boundingVolume.center,
        scratchCenter
      );
      if (Cartesian3.magnitude(centerLocal) > ellipsoid.minimumRadius) {
        // The tileset is defined in WGS84. Approximate the minimum and maximum height.
        const centerCartographic = Cartographic.fromCartesian(
          centerLocal,
          ellipsoid,
          scratchCartographic
        );
        up = Cartesian3.normalize(camera.positionWC, scratchPositionNormal);
        direction = camera.directionWC;
        height = camera.positionCartographic.height;
        minimumHeight = 0.0;
        maximumHeight = centerCartographic.height * 2.0;
      } else {
        // The tileset is defined in local coordinates (z-up)
        const positionLocal = _math_gl_core__WEBPACK_IMPORTED_MODULE_0__["Matrix4"].multiplyByPoint(
          transformLocal,
          camera.positionWC,
          scratchPosition
        );
        up = Cartesian3.UNIT_Z;
        direction = _math_gl_core__WEBPACK_IMPORTED_MODULE_0__["Matrix4"].multiplyByPointAsVector(
          transformLocal,
          camera.directionWC,
          scratchDirection
        );
        direction = Cartesian3.normalize(direction, direction);
        height = positionLocal.z;
        if (tileBoundingVolume instanceof TileOrientedBoundingBox) {
          // Assuming z-up, the last component stores the half-height of the box
          const boxHeight = root._header.boundingVolume.box[11];
          minimumHeight = centerLocal.z - boxHeight;
          maximumHeight = centerLocal.z + boxHeight;
        } else if (tileBoundingVolume instanceof TileBoundingSphere) {
          const radius = boundingVolume.radius;
          minimumHeight = centerLocal.z - radius;
          maximumHeight = centerLocal.z + radius;
        }
      }
    }
  
    // The range where the density starts to lessen. Start at the quarter height of the tileset.
    const heightFalloff = dynamicScreenSpaceErrorHeightFalloff;
    const heightClose = minimumHeight + (maximumHeight - minimumHeight) * heightFalloff;
    const heightFar = maximumHeight;
  
    const t = Object(_math_gl_core__WEBPACK_IMPORTED_MODULE_0__["clamp"])((height - heightClose) / (heightFar - heightClose), 0.0, 1.0);
  
    // Increase density as the camera tilts towards the horizon
    const dot = Math.abs(Cartesian3.dot(direction, up));
  
    let horizonFactor = 1.0 - dot;
  
    // Weaken the horizon factor as the camera height increases, implying the camera is further away from the tileset.
    // The goal is to increase density for the "street view", not when viewing the tileset from a distance.
    horizonFactor = horizonFactor * (1.0 - t);
  
    return dynamicScreenSpaceErrorDensity * horizonFactor;
  }
  
  function fog(distanceToCamera, density) {
    const scalar = distanceToCamera * density;
    return 1.0 - Math.exp(-(scalar * scalar));
  }
  
  function getDynamicScreenSpaceError(tileset, distanceToCamera) {
    if (tileset.dynamicScreenSpaceError && tileset._dynamicScreenSpaceErrorComputedDensity) {
      const density = tileset._dynamicScreenSpaceErrorComputedDensity;
      const factor = tileset.dynamicScreenSpaceErrorFactor;
      // TODO: Refined screen space error that minimizes tiles in non-first-person
      const dynamicError = fog(distanceToCamera, density) * factor;
      return dynamicError;
    }
  
    return 0;
  }
  
  function getTiles3DScreenSpaceError(tile, frameState, useParentLodMetric) {
    const tileset = tile.tileset;
    const parentLodMetricValue = (tile.parent && tile.parent.lodMetricValue) || tile.lodMetricValue;
    const lodMetricValue = useParentLodMetric ? parentLodMetricValue : tile.lodMetricValue;
  
    // Leaf tiles do not have any error so save the computation
    if (lodMetricValue === 0.0) {
      return 0.0;
    }
  
    // TODO: Orthographic Frustum needs special treatment?
    // this._getOrthograhicScreenSpaceError();
  
    // Avoid divide by zero when viewer is inside the tile
    const distance = Math.max(tile._distanceToCamera, 1e-7);
    const {height, sseDenominator} = frameState;
    let error = (lodMetricValue * height) / (distance * sseDenominator);
  
    error -= getDynamicScreenSpaceError(tileset, distance);
  
    return error;
  }
  
  
  /***/ }),
  
  /***/ "./src/tileset/helpers/transform-utils.js":
  /*!************************************************!*\
    !*** ./src/tileset/helpers/transform-utils.js ***!
    \************************************************/
  /*! exports provided: calculateTransformProps */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "calculateTransformProps", function() { return calculateTransformProps; });
  /* harmony import */ var _math_gl_geospatial__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @math.gl/geospatial */ "./node_modules/@math.gl/geospatial/dist/esm/index.js");
  /* harmony import */ var _math_gl_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @math.gl/core */ "../../node_modules/@math.gl/core/dist/esm/index.js");
  /* harmony import */ var _loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @loaders.gl/loader-utils */ "../loader-utils/src/index.js");
  
  
  
  
  function calculateTransformProps(tileHeader, tile) {
    Object(_loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_2__["assert"])(tileHeader);
    Object(_loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_2__["assert"])(tile);
  
    const {rtcCenter, rotateYtoZ} = tile;
    const {
      computedTransform,
      boundingVolume: {center}
    } = tileHeader;
  
    let modelMatrix = new _math_gl_core__WEBPACK_IMPORTED_MODULE_1__["Matrix4"](computedTransform);
  
    // Translate if appropriate
    if (rtcCenter) {
      modelMatrix.translate(rtcCenter);
    }
  
    // glTF models need to be rotated from Y to Z up
    // https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification#y-up-to-z-up
    if (rotateYtoZ) {
      const rotation = new _math_gl_core__WEBPACK_IMPORTED_MODULE_1__["Matrix4"]().rotateX(Math.PI / 2);
      modelMatrix = modelMatrix.multiplyRight(rotation);
    }
  
    // Scale/offset positions if normalized integers
    if (tile.isQuantized) {
      modelMatrix.translate(tile.quantizedVolumeOffset).scale(tile.quantizedVolumeScale);
    }
  
    // Option 1: Cartesian matrix and origin
    const cartesianOrigin = new _math_gl_core__WEBPACK_IMPORTED_MODULE_1__["Vector3"](center);
  
    tile.cartesianModelMatrix = modelMatrix;
    tile.cartesianOrigin = cartesianOrigin;
  
    // Option 2: Cartographic matrix and origin
    const cartographicOrigin = _math_gl_geospatial__WEBPACK_IMPORTED_MODULE_0__["Ellipsoid"].WGS84.cartesianToCartographic(
      cartesianOrigin,
      new _math_gl_core__WEBPACK_IMPORTED_MODULE_1__["Vector3"]()
    );
    const fromFixedFrameMatrix = _math_gl_geospatial__WEBPACK_IMPORTED_MODULE_0__["Ellipsoid"].WGS84.eastNorthUpToFixedFrame(cartesianOrigin);
    const toFixedFrameMatrix = fromFixedFrameMatrix.invert();
  
    tile.cartographicModelMatrix = toFixedFrameMatrix.multiplyRight(modelMatrix);
    tile.cartographicOrigin = cartographicOrigin;
  
    // Deprecated, drop
    tile.modelMatrix = tile.cartographicModelMatrix;
  }
  
  
  /***/ }),
  
  /***/ "./src/tileset/helpers/zoom.js":
  /*!*************************************!*\
    !*** ./src/tileset/helpers/zoom.js ***!
    \*************************************/
  /*! exports provided: getZoomFromBoundingVolume */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getZoomFromBoundingVolume", function() { return getZoomFromBoundingVolume; });
  /* harmony import */ var _math_gl_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @math.gl/core */ "../../node_modules/@math.gl/core/dist/esm/index.js");
  
  
  const WGS84_RADIUS_X = 6378137.0;
  const WGS84_RADIUS_Y = 6378137.0;
  const WGS84_RADIUS_Z = 6356752.3142451793;
  
  const scratchVector = new _math_gl_core__WEBPACK_IMPORTED_MODULE_0__["Vector3"]();
  
  function getZoomFromBoundingVolume(boundingVolume) {
    const {halfAxes, radius, width, height} = boundingVolume;
  
    if (halfAxes) {
      // OrientedBoundingBox
      halfAxes.getColumn(0, scratchVector);
      const x = scratchVector.len();
      halfAxes.getColumn(1, scratchVector);
      const y = scratchVector.len();
      halfAxes.getColumn(2, scratchVector);
      const z = scratchVector.len();
  
      const halfX = x / 2;
      const halfY = y / 2;
      const halfZ = z / 2;
  
      const zoomX = Math.log2(WGS84_RADIUS_X / halfX);
      const zoomY = Math.log2(WGS84_RADIUS_Y / halfY);
      const zoomZ = Math.log2(WGS84_RADIUS_Z / halfZ);
      return (zoomX + zoomY + zoomZ) / 3;
    } else if (radius) {
      // BoundingSphere
      return Math.log2(WGS84_RADIUS_Z / radius);
    } else if (height && width) {
      // BoundingRectangle
      const zoomX = Math.log2(WGS84_RADIUS_X / width);
      const zoomY = Math.log2(WGS84_RADIUS_Y / height);
  
      return (zoomX + zoomY) / 2;
    }
  
    return 1;
  }
  
  
  /***/ }),
  
  /***/ "./src/tileset/tile-3d.js":
  /*!********************************!*\
    !*** ./src/tileset/tile-3d.js ***!
    \********************************/
  /*! exports provided: default */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return TileHeader; });
  /* harmony import */ var _math_gl_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @math.gl/core */ "../../node_modules/@math.gl/core/dist/esm/index.js");
  /* harmony import */ var _math_gl_culling__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @math.gl/culling */ "../../node_modules/@math.gl/culling/dist/esm/index.js");
  /* harmony import */ var _loaders_gl_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @loaders.gl/core */ "../core/src/index.js");
  /* harmony import */ var _loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @loaders.gl/loader-utils */ "../loader-utils/src/index.js");
  /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../constants */ "./src/constants.js");
  /* harmony import */ var _helpers_bounding_volume__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./helpers/bounding-volume */ "./src/tileset/helpers/bounding-volume.js");
  /* harmony import */ var _helpers_tiles_3d_lod__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./helpers/tiles-3d-lod */ "./src/tileset/helpers/tiles-3d-lod.js");
  /* harmony import */ var _helpers_i3s_lod__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./helpers/i3s-lod */ "./src/tileset/helpers/i3s-lod.js");
  // This file is derived from the Cesium code base under Apache 2 license
  // See LICENSE.md and https://github.com/AnalyticalGraphicsInc/cesium/blob/master/LICENSE.md
  
  
  
  
  
  
  
  
  
  
  
  const scratchVector = new _math_gl_core__WEBPACK_IMPORTED_MODULE_0__["Vector3"]();
  
  function defined(x) {
    return x !== undefined && x !== null;
  }
  
  function updatePriority(tile) {
    // Check if any reason to abort
    if (!tile.isVisible) {
      return -1;
    }
    if (tile.contentState === _constants__WEBPACK_IMPORTED_MODULE_4__["TILE_CONTENT_STATE"].UNLOADED) {
      return -1;
    }
  
    return Math.max(1e7 - tile._priority, 0) || 0;
  }
  
  // A Tile3DHeader represents a tile as Tileset3D. When a tile is first created, its content is not loaded;
  // the content is loaded on-demand when needed based on the view.
  // Do not construct this directly, instead access tiles through {@link Tileset3D#tileVisible}.
  class TileHeader {
    // eslint-disable-next-line max-statements
    constructor(tileset, header, parentHeader) {
      Object(_loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_3__["assert"])(typeof header === 'object');
  
      // PUBLIC MEMBERS
      // original tile data
      this.header = header;
      // The tileset containing this tile.
      this.tileset = tileset;
      this.id = header.id;
      this.url = header.url;
      // This tile's parent or `undefined` if this tile is the root.
      this.parent = parentHeader;
      this.refine = this._getRefine(header.refine);
      this.type = header.type;
      this.contentUrl = header.contentUrl;
      // The error, in meters, introduced if this tile is rendered and its children are not.
      this.lodMetricType = null;
      this.lodMetricValue = null;
      // Specifies the type of refine that is used when traversing this tile for rendering.
      this.boundingVolume = null;
      // The tile's content.  This represents the actual tile's payload,
      // not the content's metadata in the tileset JSON file.
      this.content = null;
      this.contentState = _constants__WEBPACK_IMPORTED_MODULE_4__["TILE_CONTENT_STATE"].UNLOADED;
      this.gpuMemoryUsageInBytes = 0;
      // The tile's children - an array of Tile3D objects.
      this.children = [];
  
      this.depth = 0;
  
      // PRIVATE MEMBERS
      this._cacheNode = null;
      this._frameNumber = null;
      this._cacheNode = null;
  
      this._initializeLodMetric(header);
      this._initializeTransforms(header);
      this._initializeBoundingVolumes(header);
      this._initializeContent(header);
      this._initializeRenderingState(header);
  
      // TODO i3s specific, needs to remove
      this._lodJudge = null;
  
      // TODO Cesium 3d tiles specific
      this._expireDate = null;
      this._expiredContent = null;
  
      Object.seal(this);
    }
  
    destroy() {
      this.header = null;
    }
  
    isDestroyed() {
      return this.header === null;
    }
  
    get selected() {
      return this._selectedFrame === this.tileset._frameNumber;
    }
  
    get isVisible() {
      return this._visible;
    }
  
    get isVisibleAndInRequestVolume() {
      return this._visible && this._inRequestVolume;
    }
  
    // Returns true if tile is not an empty tile and not an external tileset
    get hasRenderContent() {
      return !this.hasEmptyContent && !this.hasTilesetContent;
    }
  
    get hasChildren() {
      return this.children.length > 0 || (this.header.children && this.header.children.length > 0);
    }
  
    // Determines if the tile's content is ready. This is automatically `true` for
    // tile's with empty content.
    get contentReady() {
      return this.contentState === _constants__WEBPACK_IMPORTED_MODULE_4__["TILE_CONTENT_STATE"].READY || this.hasEmptyContent;
    }
  
    // Determines if the tile has available content to render.  `true` if the tile's
    // content is ready or if it has expired content this renders while new content loads; otherwise,
    get contentAvailable() {
      return Boolean(
        (this.contentReady && this.hasRenderContent) || (this._expiredContent && !this.contentFailed)
      );
    }
  
    // Returns true if tile has renderable content but it's unloaded
    get hasUnloadedContent() {
      return this.hasRenderContent && this.contentUnloaded;
    }
  
    // Determines if the tile's content has not be requested. `true` if tile's
    // content has not be requested; otherwise, `false`.
    get contentUnloaded() {
      return this.contentState === _constants__WEBPACK_IMPORTED_MODULE_4__["TILE_CONTENT_STATE"].UNLOADED;
    }
  
    // Determines if the tile's content is expired. `true` if tile's
    // content is expired; otherwise, `false`.
    get contentExpired() {
      return this.contentState === _constants__WEBPACK_IMPORTED_MODULE_4__["TILE_CONTENT_STATE"].EXPIRED;
    }
  
    // Determines if the tile's content failed to load.  `true` if the tile's
    // content failed to load; otherwise, `false`.
    get contentFailed() {
      return this.contentState === _constants__WEBPACK_IMPORTED_MODULE_4__["TILE_CONTENT_STATE"].FAILED;
    }
  
    // Get the tile's screen space error.
    getScreenSpaceError(frameState, useParentLodMetric) {
      switch (this.tileset.type) {
        case _constants__WEBPACK_IMPORTED_MODULE_4__["TILESET_TYPE"].I3S:
          return Object(_helpers_i3s_lod__WEBPACK_IMPORTED_MODULE_7__["getI3ScreenSize"])(this, frameState);
        case _constants__WEBPACK_IMPORTED_MODULE_4__["TILESET_TYPE"].TILES3D:
          return Object(_helpers_tiles_3d_lod__WEBPACK_IMPORTED_MODULE_6__["getTiles3DScreenSpaceError"])(this, frameState, useParentLodMetric);
        default:
          // eslint-disable-next-line
          console.error('Unsupported tileset type');
          return null;
      }
    }
  
    // Requests the tile's content.
    // The request may not be made if the Request Scheduler can't prioritize it.
    // eslint-disable-next-line max-statements
    async loadContent() {
      if (this.hasEmptyContent) {
        return false;
      }
  
      if (this.content) {
        return true;
      }
  
      const expired = this.contentExpired;
  
      if (expired) {
        this._expireDate = null;
      }
  
      this.contentState = _constants__WEBPACK_IMPORTED_MODULE_4__["TILE_CONTENT_STATE"].LOADING;
  
      const cancelled = !(await this.tileset._requestScheduler.scheduleRequest(this, updatePriority));
  
      if (cancelled) {
        this.contentState = _constants__WEBPACK_IMPORTED_MODULE_4__["TILE_CONTENT_STATE"].UNLOADED;
        return false;
      }
  
      try {
        const contentUrl = this.tileset.getTileUrl(this.contentUrl);
        this.tileset._requestScheduler.startRequest(this);
        // The content can be a binary tile ot a JSON tileset
        const fetchOptions = this.tileset.fetchOptions;
        const loader = this.tileset.loader;
        const options = {
          ...fetchOptions,
          [loader.id]: {
            tile: this.header,
            tileset: this.tileset.tileset
          }
        };
  
        this.content = await Object(_loaders_gl_core__WEBPACK_IMPORTED_MODULE_2__["load"])(contentUrl, loader, options);
        if (this._isTileset()) {
          // Add tile headers for the nested tilset's subtree
          // Async update of the tree should be fine since there would never be edits to the same node
          // TODO - we need to capture the child tileset's URL
          this.tileset._initializeTileHeaders(this.content, this, _loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_3__["path"].dirname(this.contentUrl));
        }
  
        this.contentState = _constants__WEBPACK_IMPORTED_MODULE_4__["TILE_CONTENT_STATE"].READY;
        this._onContentLoaded();
        return true;
      } catch (error) {
        // Tile is unloaded before the content finishes loading
        this.contentState = _constants__WEBPACK_IMPORTED_MODULE_4__["TILE_CONTENT_STATE"].FAILED;
        throw error;
      } finally {
        this.tileset._requestScheduler.endRequest(this);
      }
    }
  
    // Unloads the tile's content.
    unloadContent() {
      if (this.content && this.content.destroy) {
        this.content.destroy();
      }
      this.content = null;
      this.contentState = _constants__WEBPACK_IMPORTED_MODULE_4__["TILE_CONTENT_STATE"].UNLOADED;
      return true;
    }
  
    // Update the tile's visibility.
    updateVisibility(frameState) {
      if (this._frameNumber === frameState.frameNumber) {
        // Return early if visibility has already been checked during the traversal.
        // The visibility may have already been checked if the cullWithChildrenBounds optimization is used.
        return;
      }
  
      const parent = this.parent;
      const parentTransform = parent ? parent.computedTransform : this.tileset.modelMatrix;
      const parentVisibilityPlaneMask = parent
        ? parent._visibilityPlaneMask
        : _math_gl_culling__WEBPACK_IMPORTED_MODULE_1__["CullingVolume"].MASK_INDETERMINATE;
  
      this._updateTransform(parentTransform);
      this._distanceToCamera = this.distanceToTile(frameState);
      this._screenSpaceError = this.getScreenSpaceError(frameState, false);
      this._visibilityPlaneMask = this.visibility(frameState, parentVisibilityPlaneMask); // Use parent's plane mask to speed up visibility test
      this._visible = this._visibilityPlaneMask !== _math_gl_culling__WEBPACK_IMPORTED_MODULE_1__["CullingVolume"].MASK_OUTSIDE;
      this._inRequestVolume = this.insideViewerRequestVolume(frameState);
  
      this._priority = this.lodMetricValue;
      this._frameNumber = frameState.frameNumber;
    }
  
    // Determines whether the tile's bounding volume intersects the culling volume.
    // @param {FrameState} frameState The frame state.
    // @param {Number} parentVisibilityPlaneMask The parent's plane mask to speed up the visibility check.
    // @returns {Number} A plane mask as described above in {@link CullingVolume#computeVisibilityWithPlaneMask}.
    visibility(frameState, parentVisibilityPlaneMask) {
      const {cullingVolume} = frameState;
      const {boundingVolume} = this;
  
      // TODO Cesium specific - restore clippingPlanes
      // const {clippingPlanes, clippingPlanesOriginMatrix} = tileset;
      // if (clippingPlanes && clippingPlanes.enabled) {
      //   const intersection = clippingPlanes.computeIntersectionWithBoundingVolume(
      //     boundingVolume,
      //     clippingPlanesOriginMatrix
      //   );
      //   this._isClipped = intersection !== Intersect.INSIDE;
      //   if (intersection === Intersect.OUTSIDE) {
      //     return CullingVolume.MASK_OUTSIDE;
      //   }
      // }
  
      // return cullingVolume.computeVisibilityWithPlaneMask(boundingVolume, parentVisibilityPlaneMask);
      return cullingVolume.computeVisibilityWithPlaneMask(boundingVolume, parentVisibilityPlaneMask);
    }
  
    // Assuming the tile's bounding volume intersects the culling volume, determines
    // whether the tile's content's bounding volume intersects the culling volume.
    // @param {FrameState} frameState The frame state.
    // @returns {Intersect} The result of the intersection: the tile's content is completely outside, completely inside, or intersecting the culling volume.
    contentVisibility(frameState) {
      return true;
  
      // TODO restore
      /*
      // Assumes the tile's bounding volume intersects the culling volume already, so
      // just return Intersect.INSIDE if there is no content bounding volume.
      if (!defined(this.contentBoundingVolume)) {
        return Intersect.INSIDE;
      }
  
      if (this._visibilityPlaneMask === CullingVolume.MASK_INSIDE) {
        // The tile's bounding volume is completely inside the culling volume so
        // the content bounding volume must also be inside.
        return Intersect.INSIDE;
      }
  
      // PERFORMANCE_IDEA: is it possible to burn less CPU on this test since we know the
      // tile's (not the content's) bounding volume intersects the culling volume?
      const cullingVolume = frameState.cullingVolume;
      const boundingVolume = tile.contentBoundingVolume;
  
      const tileset = this.tileset;
      const clippingPlanes = tileset.clippingPlanes;
      if (defined(clippingPlanes) && clippingPlanes.enabled) {
        const intersection = clippingPlanes.computeIntersectionWithBoundingVolume(
          boundingVolume,
          tileset.clippingPlanesOriginMatrix
        );
        this._isClipped = intersection !== Intersect.INSIDE;
        if (intersection === Intersect.OUTSIDE) {
          return Intersect.OUTSIDE;
        }
      }
  
      return cullingVolume.computeVisibility(boundingVolume);
      */
    }
  
    // Computes the (potentially approximate) distance from the closest point of the tile's bounding volume to the camera.
    // @param {FrameState} frameState The frame state.
    // @returns {Number} The distance, in meters, or zero if the camera is inside the bounding volume.
    distanceToTile(frameState) {
      const boundingVolume = this.boundingVolume;
      return Math.sqrt(Math.max(boundingVolume.distanceSquaredTo(frameState.camera.position), 0));
    }
  
    // Computes the tile's camera-space z-depth.
    // @param {FrameState} frameState The frame state.
    // @returns {Number} The distance, in meters.
    cameraSpaceZDepth({camera}) {
      const boundingVolume = this.boundingVolume; // Gets the underlying OrientedBoundingBox or BoundingSphere
      scratchVector.subVectors(boundingVolume.center, camera.position);
      return camera.direction.dot(scratchVector);
    }
  
    /**
     * Checks if the camera is inside the viewer request volume.
     * @param {FrameState} frameState The frame state.
     * @returns {Boolean} Whether the camera is inside the volume.
     */
    insideViewerRequestVolume(frameState) {
      const viewerRequestVolume = this._viewerRequestVolume;
      return !viewerRequestVolume || viewerRequestVolume.distanceToCamera(frameState) === 0.0;
    }
  
    _initializeLodMetric(header) {
      if ('lodMetricType' in header) {
        this.lodMetricType = header.lodMetricType;
      } else {
        this.lodMetricType = (this.parent && this.parent.lodMetricType) || this.tileset.lodMetricType;
        // eslint-disable-next-line
        console.warn(`3D Tile: Required prop lodMetricType is undefined. Using parent lodMetricType`);
      }
  
      // This is used to compute screen space error, i.e., the error measured in pixels.
      if ('lodMetricValue' in header) {
        this.lodMetricValue = header.lodMetricValue;
      } else {
        this.lodMetricValue =
          (this.parent && this.parent.lodMetricValue) || this.tileset.lodMetricValue;
        // eslint-disable-next-line
        console.warn(
          `3D Tile: Required prop lodMetricValue is undefined. Using parent lodMetricValue`
        );
      }
    }
  
    _initializeTransforms(tileHeader) {
      // The local transform of this tile.
      this.transform = tileHeader.transform ? new _math_gl_core__WEBPACK_IMPORTED_MODULE_0__["Matrix4"](tileHeader.transform) : new _math_gl_core__WEBPACK_IMPORTED_MODULE_0__["Matrix4"]();
  
      const parent = this.parent;
      const tileset = this.tileset;
  
      const parentTransform =
        parent && parent.computedTransform
          ? parent.computedTransform.clone()
          : tileset.modelMatrix.clone();
      this.computedTransform = new _math_gl_core__WEBPACK_IMPORTED_MODULE_0__["Matrix4"](parentTransform).multiplyRight(this.transform);
  
      const parentInitialTransform =
        parent && parent._initialTransform ? parent._initialTransform.clone() : new _math_gl_core__WEBPACK_IMPORTED_MODULE_0__["Matrix4"]();
      this._initialTransform = new _math_gl_core__WEBPACK_IMPORTED_MODULE_0__["Matrix4"](parentInitialTransform).multiplyRight(this.transform);
    }
  
    _initializeBoundingVolumes(tileHeader) {
      this._contentBoundingVolume = null;
      this._viewerRequestVolume = null;
  
      this._updateBoundingVolume(tileHeader);
    }
  
    _initializeContent(tileHeader) {
      // Empty tile by default
      this.content = {_tileset: this.tileset, _tile: this};
      this.hasEmptyContent = true;
      this.contentState = _constants__WEBPACK_IMPORTED_MODULE_4__["TILE_CONTENT_STATE"].UNLOADED;
  
      // When `true`, the tile's content points to an external tileset.
      // This is `false` until the tile's content is loaded.
      this.hasTilesetContent = false;
  
      if (tileHeader.contentUrl) {
        this.content = null;
        this.hasEmptyContent = false;
      }
    }
  
    // TODO - remove anything not related to basic visibility detection
    _initializeRenderingState(header) {
      this.depth = header.level;
      this._shouldRefine = false;
  
      // Members this are updated every frame for tree traversal and rendering optimizations:
      this._distanceToCamera = 0;
      this._centerZDepth = 0;
      this._screenSpaceError = 0;
      this._visibilityPlaneMask = _math_gl_culling__WEBPACK_IMPORTED_MODULE_1__["CullingVolume"].MASK_INDETERMINATE;
      this._visible = false;
      this._inRequestVolume = false;
  
      this._stackLength = 0;
      this._selectionDepth = 0;
  
      this._frameNumber = 0;
      this._touchedFrame = 0;
      this._visitedFrame = 0;
      this._selectedFrame = 0;
      this._requestedFrame = 0;
  
      this._priority = 0.0;
    }
  
    _getRefine(refine) {
      // Inherit from parent tile if omitted.
      return refine || (this.parent && this.parent.refine) || _constants__WEBPACK_IMPORTED_MODULE_4__["TILE_REFINEMENT"].REPLACE;
    }
  
    _isTileset() {
      return this.contentUrl.indexOf('.json') !== -1;
    }
  
    _onContentLoaded() {
      // Vector and Geometry tile rendering do not support the skip LOD optimization.
      switch (this.content && this.content.type) {
        case 'vctr':
        case 'geom':
          this.tileset.traverser.disableSkipLevelOfDetail = true;
          break;
        default:
      }
  
      // The content may be tileset json
      if (this._isTileset()) {
        this.hasTilesetContent = true;
      }
    }
  
    _updateBoundingVolume(header) {
      // Update the bounding volumes
      this.boundingVolume = Object(_helpers_bounding_volume__WEBPACK_IMPORTED_MODULE_5__["createBoundingVolume"])(
        header.boundingVolume,
        this.computedTransform,
        this.boundingVolume
      );
  
      const content = header.content;
      if (!content) {
        return;
      }
  
      // TODO Cesium specific
      // Non-leaf tiles may have a content bounding-volume, which is a tight-fit bounding volume
      // around only the features in the tile. This box is useful for culling for rendering,
      // but not for culling for traversing the tree since it does not guarantee spatial coherence, i.e.,
      // since it only bounds features in the tile, not the entire tile, children may be
      // outside of this box.
      if (content.boundingVolume) {
        this._contentBoundingVolume = Object(_helpers_bounding_volume__WEBPACK_IMPORTED_MODULE_5__["createBoundingVolume"])(
          content.boundingVolume,
          this.computedTransform,
          this._contentBoundingVolume
        );
      }
      if (header.viewerRequestVolume) {
        this._viewerRequestVolume = Object(_helpers_bounding_volume__WEBPACK_IMPORTED_MODULE_5__["createBoundingVolume"])(
          header.viewerRequestVolume,
          this.computedTransform,
          this._viewerRequestVolume
        );
      }
    }
  
    // Update the tile's transform. The transform is applied to the tile's bounding volumes.
    _updateTransform(parentTransform = new _math_gl_core__WEBPACK_IMPORTED_MODULE_0__["Matrix4"]()) {
      const computedTransform = parentTransform.clone().multiplyRight(this.transform);
      const didTransformChange = !computedTransform.equals(this.computedTransform);
  
      if (!didTransformChange) {
        return;
      }
  
      this.computedTransform = computedTransform;
  
      this._updateBoundingVolume(this.header);
    }
  
    // TODO Cesium specific
    // Update whether the tile has expired.
    updateExpiration() {
      if (defined(this._expireDate) && this.contentReady && !this.hasEmptyContent) {
        const now = Date.now();
        if (Date.lessThan(this._expireDate, now)) {
          this.contentState = _constants__WEBPACK_IMPORTED_MODULE_4__["TILE_CONTENT_STATE"].EXPIRED;
          this._expiredContent = this.content;
        }
      }
    }
  
    get extras() {
      return this.header.extras;
    }
  }
  
  
  /***/ }),
  
  /***/ "./src/tileset/tileset-3d.js":
  /*!***********************************!*\
    !*** ./src/tileset/tileset-3d.js ***!
    \***********************************/
  /*! exports provided: default */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Tileset3D; });
  /* harmony import */ var _math_gl_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @math.gl/core */ "../../node_modules/@math.gl/core/dist/esm/index.js");
  /* harmony import */ var _math_gl_geospatial__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @math.gl/geospatial */ "./node_modules/@math.gl/geospatial/dist/esm/index.js");
  /* harmony import */ var _probe_gl_stats__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @probe.gl/stats */ "../../node_modules/@probe.gl/stats/dist/esm/index.js");
  /* harmony import */ var _loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @loaders.gl/loader-utils */ "../loader-utils/src/index.js");
  /* harmony import */ var _tileset_cache__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./tileset-cache */ "./src/tileset/tileset-cache.js");
  /* harmony import */ var _helpers_transform_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./helpers/transform-utils */ "./src/tileset/helpers/transform-utils.js");
  /* harmony import */ var _helpers_frame_state__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./helpers/frame-state */ "./src/tileset/helpers/frame-state.js");
  /* harmony import */ var _helpers_zoom__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./helpers/zoom */ "./src/tileset/helpers/zoom.js");
  /* harmony import */ var _tile_3d__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./tile-3d */ "./src/tileset/tile-3d.js");
  /* harmony import */ var _traversers_tileset_3d_traverser__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./traversers/tileset-3d-traverser */ "./src/tileset/traversers/tileset-3d-traverser.js");
  /* harmony import */ var _traversers_tileset_traverser__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./traversers/tileset-traverser */ "./src/tileset/traversers/tileset-traverser.js");
  /* harmony import */ var _traversers_i3s_tilset_traverser__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./traversers/i3s-tilset-traverser */ "./src/tileset/traversers/i3s-tilset-traverser.js");
  /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../constants */ "./src/constants.js");
  // This file is derived from the Cesium code base under Apache 2 license
  // See LICENSE.md and https://github.com/AnalyticalGraphicsInc/cesium/blob/master/LICENSE.md
  
  /*
  
    The Tileset loading and rendering flow is as below,
    A rendered (i.e. deck.gl `Tile3DLayer`) triggers `tileset.update()` after a `tileset` is loaded
    `tileset` starts traversing the tile tree and update `requestTiles` (tiles of which content need
    to be fetched) and `selectedTiles` (tiles ready for rendering under the current viewport).
    `Tile3DLayer` will update rendering based on `selectedTiles`.
    `Tile3DLayer` also listens to `onTileLoad` callback and trigger another round of `update and then traversal`
    when new tiles are loaded.
  
    As I3S tileset have stored `tileHeader` file (metadata) and tile content files (geometry, texture, ...) separately.
    During each traversal, it issues `tilHeader` requests if that `tileHeader` is not yet fetched,
    after the tile header is fulfilled, it will resume the traversal starting from the tile just fetched (not root).
  
    Tile3DLayer
         |
     await load(tileset)
         |
     tileset.update()
         |                async load tileHeader
     tileset.traverse() -------------------------- Queued
         |        resume traversal after fetched  |
         |----------------------------------------|
         |
         |                     async load tile content
    tilset.requestedTiles  ----------------------------- RequestScheduler
                                                                |
    tilset.selectedTiles (ready for rendering)                  |
         |         Listen to                                    |
      Tile3DLayer ----------- onTileLoad  ----------------------|
         |                         |   notify new tile is available
      updateLayers                 |
                          tileset.update // trigger another round of update
  
  */
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  // Tracked Stats
  const TILES_TOTAL = 'Tiles In Tileset(s)';
  const TILES_IN_MEMORY = 'Tiles In Memory';
  const TILES_IN_VIEW = 'Tiles In View';
  const TILES_RENDERABLE = 'Tiles To Render';
  const TILES_LOADED = 'Tiles Loaded';
  const TILES_LOADING = 'Tiles Loading';
  const TILES_UNLOADED = 'Tiles Unloaded';
  const TILES_LOAD_FAILED = 'Failed Tile Loads';
  const POINTS_COUNT = 'Points';
  const TILES_GPU_MEMORY = 'Tile Memory Use';
  
  function getQueryParamString(queryParams) {
    const queryParamStrings = [];
    for (const key of Object.keys(queryParams)) {
      queryParamStrings.push(`${key}=${queryParams[key]}`);
    }
    switch (queryParamStrings.length) {
      case 0:
        return '';
      case 1:
        return `?${queryParamStrings[0]}`;
      default:
        return `?${queryParamStrings.join('&')}`;
    }
  }
  
  const DEFAULT_OPTIONS = {
    ellipsoid: _math_gl_geospatial__WEBPACK_IMPORTED_MODULE_1__["Ellipsoid"].WGS84,
    // A 4x4 transformation matrix this transforms the entire tileset.
    modelMatrix: new _math_gl_core__WEBPACK_IMPORTED_MODULE_0__["Matrix4"](),
  
    // Set to true to enable experimental request throttling, for improved performance
    throttleRequests: false,
  
    maximumMemoryUsage: 32,
  
    // Indicates this a tile's content was loaded
    onTileLoad: () => {},
    // Indicates this a tile's content was unloaded
    onTileUnload: () => {},
    onTileError: (tile, message, url) => {},
  
    // TODO CESIUM
    // The maximum screen space error used to drive level of detail refinement.
    maximumScreenSpaceError: 8
    // dynamicScreenSpaceError: false,
    // dynamicScreenSpaceErrorDensity: 0.00278,
    // dynamicScreenSpaceErrorFactor: 4.0,
    // Optimization option. Determines if level of detail skipping should be applied during the traversal.
    // skipLevelOfDetail: false,
    // The screen space error this must be reached before skipping levels of detail.
    // baseScreenSpaceError: 1024
  };
  
  class Tileset3D {
    // eslint-disable-next-line max-statements
    constructor(json, options = {}) {
      Object(_loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_3__["assert"])(json);
  
      // PUBLIC MEMBERS
      this.options = {...DEFAULT_OPTIONS, ...options};
      // raw data
      this.tileset = json;
      this.loader = json.loader;
      // could be  3d tiles, i3s
      this.type = json.type;
      // The url to a tileset JSON file.
      this.url = json.url;
      this.basePath = json.basePath || _loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_3__["path"].dirname(this.url);
      this.modelMatrix = this.options.modelMatrix;
      this.ellipsoid = this.options.ellipsoid;
  
      // Geometric error when the tree is not rendered at all
      this.lodMetricType = json.lodMetricType;
      this.lodMetricValue = json.lodMetricValue;
      this.refine = json.root.refine;
  
      // TODO add to loader context?
      this.fetchOptions = this.options.fetchOptions || {};
      if (this.options.headers) {
        this.fetchOptions.headers = this.options.headers;
      }
      if (this.options.token) {
        this.fetchOptions.token = this.options.token;
      }
  
      this.root = null;
      // view props
      this.cartographicCenter = null;
      this.cartesianCenter = null;
      this.zoom = 1;
      this.boundingVolume = null;
  
      // TRAVERSAL
      this._traverser = this._initializeTraverser();
      this._cache = new _tileset_cache__WEBPACK_IMPORTED_MODULE_4__["default"]();
      this._requestScheduler = new _loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_3__["RequestScheduler"]({
        throttleRequests: this.options.throttleRequests
      });
      // update tracker
      // increase in each update cycle
      this._frameNumber = 0;
      // increase when tiles selected for rendering changed
      this._updateFrameNumber = 0;
      // counter for tracking tiles requests
      this._pendingCount = 0;
  
      // HOLD TRAVERSAL RESULTS
      this._tiles = {};
      this.selectedTiles = [];
      this._emptyTiles = [];
      this._requestedTiles = [];
      this._selectedTilesToStyle = [];
  
      this._queryParams = {};
      this._queryParamsString = null;
  
      // METRICS
      // The maximum amount of GPU memory (in MB) that may be used to cache tiles.
      // Tiles not in view are unloaded to enforce this.
      this.maximumMemoryUsage = this.options.maximumMemoryUsage;
      // The total amount of GPU memory in bytes used by the tileset.
      this.gpuMemoryUsageInBytes = 0;
      this.stats = new _probe_gl_stats__WEBPACK_IMPORTED_MODULE_2__["Stats"]({id: this.url});
      this._initializeStats();
  
      // TODO CESIUM specific
      this._hasMixedContent = false;
      this._maximumScreenSpaceError = this.options.maximumScreenSpaceError;
      // EXTRACTED FROM TILESET
      this._properties = undefined; // Metadata for per-model/point/etc properties
      this._extensionsUsed = undefined;
      this._gltfUpAxis = undefined;
      this._dynamicScreenSpaceErrorComputedDensity = 0.0; // Updated based on the camera position and direction
      // Metadata for the entire tileset
      this.extras = null;
      this.asset = {};
      this.credits = {};
      this.description = this.options.description;
  
      // TODO I3S Specific
      this._defaultGeometrySchema = [];
  
      this._initializeTileSet(json, this.options);
    }
  
    isLoaded() {
      return this._pendingCount === 0;
    }
  
    destroy() {
      this._destroy();
    }
  
    get tiles() {
      return Object.values(this._tiles);
    }
  
    getTileUrl(tilePath) {
      const isDataUrl = tilePath.startsWith('data:');
      if (isDataUrl) {
        return tilePath;
      }
      return `${tilePath}${this.queryParams}`;
    }
  
    update(viewport) {
      this._cache.reset();
      this._frameNumber++;
      this._frameState = Object(_helpers_frame_state__WEBPACK_IMPORTED_MODULE_6__["getFrameState"])(viewport, this._frameNumber);
      this._traverser.traverse(this.root, this._frameState, this.options);
    }
  
    _onTraversalEnd() {
      const selectedTiles = Object.values(this._traverser.selectedTiles);
      if (this._tilesChanged(this.selectedTiles, selectedTiles)) {
        this._updateFrameNumber++;
      }
  
      this.selectedTiles = selectedTiles;
      for (const tile of this.selectedTiles) {
        this._tiles[tile.id] = tile;
      }
      this._requestedTiles = Object.values(this._traverser.requestedTiles);
      this._emptyTiles = Object.values(this._traverser.emptyTiles);
  
      this._loadTiles(this._frameState);
      this._unloadTiles();
      this._updateStats();
  
      return this._updateFrameNumber;
    }
  
    _tilesChanged(oldSelectedTiles, selectedTiles) {
      if (oldSelectedTiles.length !== selectedTiles.length) {
        return true;
      }
      const set1 = new Set(oldSelectedTiles.map(t => t.id));
      const set2 = new Set(selectedTiles.map(t => t.id));
      let changed = oldSelectedTiles.filter(x => !set2.has(x.id)).length > 0;
      changed = changed || selectedTiles.filter(x => !set1.has(x.id)).length > 0;
      return changed;
    }
  
    _loadTiles(frameState) {
      // Sort requests by priority before making any requests.
      // This makes it less likely this requests will be cancelled after being issued.
      // requestedTiles.sort((a, b) => a._priority - b._priority);
      for (const tile of this._requestedTiles) {
        if (tile.contentUnloaded) {
          this._loadTile(tile, frameState);
        }
      }
    }
  
    _unloadTiles() {
      // unload tiles from cache when hit maximumMemoryUsage
      this._cache.unloadTiles(this, (tileset, tile) => tileset._unloadTile(tile));
    }
  
    _updateStats() {
      let tilesRenderable = 0;
      let pointsRenderable = 0;
      for (const tile of this.selectedTiles) {
        if (tile.contentAvailable) {
          tilesRenderable++;
          if (tile.content.pointCount) {
            pointsRenderable += tile.content.pointCount;
          }
        }
      }
  
      this.stats.get(TILES_IN_VIEW).count = this.selectedTiles.length;
      this.stats.get(TILES_RENDERABLE).count = tilesRenderable;
      this.stats.get(POINTS_COUNT).count = pointsRenderable;
    }
  
    _initializeTileSet(tilesetJson) {
      this.root = this._initializeTileHeaders(tilesetJson, null, this.basePath);
  
      // TODO CESIUM Specific
      if (this.type === _constants__WEBPACK_IMPORTED_MODULE_12__["TILESET_TYPE"].TILES3D) {
        this._initializeCesiumTileset(tilesetJson);
      }
  
      if (this.type === _constants__WEBPACK_IMPORTED_MODULE_12__["TILESET_TYPE"].I3S) {
        this._initializeI3STileset(tilesetJson);
      }
      // Calculate cartographicCenter & zoom props to help apps center view on tileset
      this._calculateViewProps();
    }
  
    // Called during initialize Tileset to initialize the tileset's cartographic center (longitude, latitude) and zoom.
    _calculateViewProps() {
      const root = this.root;
      const {center} = root.boundingVolume;
      // TODO - handle all cases
      if (!center) {
        // eslint-disable-next-line
        console.warn('center was not pre-calculated for the root tile');
        this.cartographicCenter = new _math_gl_core__WEBPACK_IMPORTED_MODULE_0__["Vector3"]();
        this.zoom = 1;
        return;
      }
      this.cartographicCenter = _math_gl_geospatial__WEBPACK_IMPORTED_MODULE_1__["Ellipsoid"].WGS84.cartesianToCartographic(center, new _math_gl_core__WEBPACK_IMPORTED_MODULE_0__["Vector3"]());
      this.cartesianCenter = center;
      this.zoom = Object(_helpers_zoom__WEBPACK_IMPORTED_MODULE_7__["getZoomFromBoundingVolume"])(root.boundingVolume);
    }
  
    _initializeStats() {
      this.stats.get(TILES_TOTAL);
      this.stats.get(TILES_LOADING);
      this.stats.get(TILES_IN_MEMORY);
      this.stats.get(TILES_IN_VIEW);
      this.stats.get(TILES_RENDERABLE);
      this.stats.get(TILES_LOADED);
      this.stats.get(TILES_UNLOADED);
      this.stats.get(TILES_LOAD_FAILED);
      this.stats.get(POINTS_COUNT, 'memory');
      this.stats.get(TILES_GPU_MEMORY, 'memory');
    }
  
    // Installs the main tileset JSON file or a tileset JSON file referenced from a tile.
    // eslint-disable-next-line max-statements
    _initializeTileHeaders(tilesetJson, parentTileHeader, basePath) {
      // A tileset JSON file referenced from a tile may exist in a different directory than the root tileset.
      // Get the basePath relative to the external tileset.
      const rootTile = new _tile_3d__WEBPACK_IMPORTED_MODULE_8__["default"](this, tilesetJson.root, parentTileHeader, basePath); // resource
  
      // If there is a parentTileHeader, add the root of the currently loading tileset
      // to parentTileHeader's children, and update its depth.
      if (parentTileHeader) {
        parentTileHeader.children.push(rootTile);
        rootTile.depth = parentTileHeader.depth + 1;
      }
  
      // Cesium 3d tiles knows the hierarchy beforehand
      if (this.type === _constants__WEBPACK_IMPORTED_MODULE_12__["TILESET_TYPE"].TILES3D) {
        const stack = [];
        stack.push(rootTile);
  
        while (stack.length > 0) {
          const tile = stack.pop();
          this.stats.get(TILES_TOTAL).incrementCount();
          const children = tile.header.children || [];
          for (const childHeader of children) {
            const childTile = new _tile_3d__WEBPACK_IMPORTED_MODULE_8__["default"](this, childHeader, tile, basePath);
            tile.children.push(childTile);
            childTile.depth = tile.depth + 1;
            stack.push(childTile);
          }
        }
      }
  
      return rootTile;
    }
  
    _initializeTraverser() {
      let TraverserClass;
      const type = this.type;
      switch (type) {
        case _constants__WEBPACK_IMPORTED_MODULE_12__["TILESET_TYPE"].TILES3D:
          TraverserClass = _traversers_tileset_3d_traverser__WEBPACK_IMPORTED_MODULE_9__["default"];
          break;
        case _constants__WEBPACK_IMPORTED_MODULE_12__["TILESET_TYPE"].I3S:
          TraverserClass = _traversers_i3s_tilset_traverser__WEBPACK_IMPORTED_MODULE_11__["default"];
          break;
        default:
          TraverserClass = _traversers_tileset_traverser__WEBPACK_IMPORTED_MODULE_10__["default"];
      }
  
      return new TraverserClass({
        basePath: this.basePath,
        onTraversalEnd: this._onTraversalEnd.bind(this)
      });
    }
  
    _destroyTileHeaders(parentTile) {
      this._destroySubtree(parentTile);
    }
  
    async _loadTile(tile, frameState) {
      let loaded;
      try {
        this._onStartTileLoading();
        loaded = await tile.loadContent(frameState);
      } catch (error) {
        this._onTileLoadError(tile, error);
      } finally {
        this._onEndTileLoading();
        this._onTileLoad(tile, loaded);
      }
    }
  
    _onTileLoadError(tile, error) {
      this.stats.get(TILES_LOAD_FAILED).incrementCount();
  
      const message = error.message || error.toString();
      const url = tile.url;
      // TODO - Allow for probe log to be injected instead of console?
      console.error(`A 3D tile failed to load: ${tile.url} ${message}`); // eslint-disable-line
      this.options.onTileError(tile, message, url);
    }
  
    _onTileLoad(tile, loaded) {
      if (!loaded) {
        return;
      }
  
      // add coordinateOrigin and modelMatrix to tile
      if (tile && tile.content) {
        Object(_helpers_transform_utils__WEBPACK_IMPORTED_MODULE_5__["calculateTransformProps"])(tile, tile.content);
      }
  
      this._addTileToCache(tile);
      this.options.onTileLoad(tile);
    }
  
    _onStartTileLoading() {
      this._pendingCount++;
      this.stats.get(TILES_LOADING).incrementCount();
    }
  
    _onEndTileLoading() {
      this._pendingCount--;
      this.stats.get(TILES_LOADING).decrementCount();
    }
  
    _addTileToCache(tile) {
      this._cache.add(this, tile, tileset => tileset._updateCacheStats(tile));
    }
  
    _updateCacheStats(tile) {
      this.stats.get(TILES_LOADED).incrementCount();
      this.stats.get(TILES_IN_MEMORY).incrementCount();
  
      // Good enough? Just use the raw binary ArrayBuffer's byte length.
      this.gpuMemoryUsageInBytes += tile.content.byteLength || 0;
      this.stats.get(TILES_GPU_MEMORY).count = this.gpuMemoryUsageInBytes;
    }
  
    _unloadTile(tile) {
      this.gpuMemoryUsageInBytes -= tile.content.byteLength || 0;
  
      this.stats.get(TILES_IN_MEMORY).decrementCount();
      this.stats.get(TILES_UNLOADED).incrementCount();
      this.stats.get(TILES_GPU_MEMORY).count = this.gpuMemoryUsageInBytes;
  
      this.options.onTileUnload(tile);
      tile.unloadContent();
    }
  
    // Traverse the tree and destroy all tiles
    _destroy() {
      const stack = [];
  
      if (this.root) {
        stack.push(this.root);
      }
  
      while (stack.length > 0) {
        const tile = stack.pop();
  
        for (const child of tile.children) {
          stack.push(child);
        }
  
        this._destroyTile(tile);
      }
      this.root = null;
    }
  
    // Traverse the tree and destroy all sub tiles
    _destroySubtree(tile) {
      const root = tile;
      const stack = [];
      stack.push(root);
      while (stack.length > 0) {
        tile = stack.pop();
        for (const child of tile.children) {
          stack.push(child);
        }
        if (tile !== root) {
          this._destroyTile(tile);
        }
      }
      root.children = [];
    }
  
    _destroyTile(tile) {
      this._cache.unloadTile(this, tile);
      this._unloadTile(tile);
      tile.destroy();
    }
  
    _initializeCesiumTileset(tilesetJson) {
      this.asset = tilesetJson.asset;
      if (!this.asset) {
        throw new Error('Tileset must have an asset property.');
      }
      if (this.asset.version !== '0.0' && this.asset.version !== '1.0') {
        throw new Error('The tileset must be 3D Tiles version 0.0 or 1.0.');
      }
  
      // Note: `asset.tilesetVersion` is version of the tileset itself (not the version of the 3D TILES standard)
      // We add this version as a `v=1.0` query param to fetch the right version and not get an older cached version
      if ('tilesetVersion' in this.asset) {
        this._queryParams.v = this.asset.tilesetVersion;
      }
  
      // TODO - ion resources have a credits property we can use for additional attribution.
      this.credits = {
        attributions: this.options.attributions || []
      };
      this.description = this.options.description;
  
      // Gets the tileset's properties dictionary object, which contains metadata about per-feature properties.
      this.properties = tilesetJson.properties;
      this.geometricError = tilesetJson.geometricError;
      this._extensionsUsed = tilesetJson.extensionsUsed;
      // Returns the extras property at the top of the tileset JSON (application specific metadata).
      this.extras = tilesetJson.extras;
    }
  
    _initializeI3STileset(tilesetJson) {
      if ('token' in this.options) {
        this._queryParams.token = this.options.token;
      }
      // Initialize default Geometry schema
      this._defaultGeometrySchema = tilesetJson.store.defaultGeometrySchema;
    }
  
    // TODO CESIUM specific
    hasExtension(extensionName) {
      return Boolean(this._extensionsUsed && this._extensionsUsed.indexOf(extensionName) > -1);
    }
  
    get queryParams() {
      if (!this._queryParamsString) {
        this._queryParamsString = getQueryParamString(this._queryParams);
      }
      return this._queryParamsString;
    }
  }
  
  
  /***/ }),
  
  /***/ "./src/tileset/tileset-cache.js":
  /*!**************************************!*\
    !*** ./src/tileset/tileset-cache.js ***!
    \**************************************/
  /*! exports provided: default */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return TilesetCache; });
  /* harmony import */ var _utils_doubly_linked_list__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/doubly-linked-list */ "./src/utils/doubly-linked-list.js");
  // This file is derived from the Cesium code base under Apache 2 license
  // See LICENSE.md and https://github.com/AnalyticalGraphicsInc/cesium/blob/master/LICENSE.md
  
  
  
  function defined(x) {
    return x !== undefined && x !== null;
  }
  
  /**
   * Stores tiles with content loaded.
   *
   * @private
   */
  class TilesetCache {
    constructor() {
      // [head, sentinel) -> tiles that weren't selected this frame and may be removed from the cache
      // (sentinel, tail] -> tiles that were selected this frame
      this._list = new _utils_doubly_linked_list__WEBPACK_IMPORTED_MODULE_0__["default"]();
      this._sentinel = this._list.add('sentinel');
      this._trimTiles = false;
    }
  
    reset() {
      // Move sentinel node to the tail so, at the start of the frame, all tiles
      // may be potentially replaced.  Tiles are moved to the right of the sentinel
      // when they are selected so they will not be replaced.
      this._list.splice(this._list.tail, this._sentinel);
    }
  
    touch(tile) {
      const node = tile._cacheNode;
      if (defined(node)) {
        this._list.splice(this._sentinel, node);
      }
    }
  
    add(tileset, tile, addCallback) {
      if (!defined(tile._cacheNode)) {
        tile._cacheNode = this._list.add(tile);
  
        if (addCallback) {
          addCallback(tileset, tile);
        }
      }
    }
  
    unloadTile(tileset, tile, unloadCallback) {
      const node = tile._cacheNode;
      if (!defined(node)) {
        return;
      }
  
      this._list.remove(node);
      tile._cacheNode = undefined;
      if (unloadCallback) {
        unloadCallback(tileset, tile);
      }
    }
  
    unloadTiles(tileset, unloadCallback) {
      const trimTiles = this._trimTiles;
      this._trimTiles = false;
  
      const list = this._list;
  
      const maximumMemoryUsageInBytes = tileset.maximumMemoryUsage * 1024 * 1024;
  
      // Traverse the list only to the sentinel since tiles/nodes to the
      // right of the sentinel were used this frame.
      // The sub-list to the left of the sentinel is ordered from LRU to MRU.
      const sentinel = this._sentinel;
      let node = list.head;
  
      while (
        node !== sentinel &&
        (tileset.gpuMemoryUsageInBytes > maximumMemoryUsageInBytes || trimTiles)
      ) {
        const tile = node.item;
        node = node.next;
        this.unloadTile(tileset, tile, unloadCallback);
      }
    }
  
    trim() {
      this._trimTiles = true;
    }
  }
  
  
  /***/ }),
  
  /***/ "./src/tileset/traversers/i3s-tile-manager.js":
  /*!****************************************************!*\
    !*** ./src/tileset/traversers/i3s-tile-manager.js ***!
    \****************************************************/
  /*! exports provided: default */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return I3STileManager; });
  const STATUS = {
    REQUESTED: 'REQUESTED',
    COMPLETED: 'COMPLETED',
    ERROR: 'ERROR'
  };
  
  // A helper class to manage tile metadata fetching
  class I3STileManager {
    constructor() {
      this._statusMap = {};
    }
  
    add(request, key, callback, frameState) {
      if (!this._statusMap[key]) {
        this._statusMap[key] = {request, callback, key, frameState, status: STATUS.REQUESTED};
        request()
          .then(data => {
            this._statusMap[key].status = STATUS.COMPLETED;
            this._statusMap[key].callback(data, frameState);
          })
          .catch(error => {
            this._statusMap[key].status = STATUS.ERROR;
            callback(error);
          });
      }
    }
  
    update(key, frameState) {
      if (this._statusMap[key]) {
        this._statusMap[key].frameState = frameState;
      }
    }
  
    find(key) {
      return this._statusMap[key];
    }
  }
  
  
  /***/ }),
  
  /***/ "./src/tileset/traversers/i3s-tilset-traverser.js":
  /*!********************************************************!*\
    !*** ./src/tileset/traversers/i3s-tilset-traverser.js ***!
    \********************************************************/
  /*! exports provided: default */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return I3STilesetTraverser; });
  /* harmony import */ var _loaders_gl_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @loaders.gl/core */ "../core/src/index.js");
  /* harmony import */ var _tileset_traverser__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./tileset-traverser */ "./src/tileset/traversers/tileset-traverser.js");
  /* harmony import */ var _helpers_i3s_lod__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../helpers/i3s-lod */ "./src/tileset/helpers/i3s-lod.js");
  /* harmony import */ var _tile_3d__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../tile-3d */ "./src/tileset/tile-3d.js");
  /* harmony import */ var _i3s_tile_manager__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./i3s-tile-manager */ "./src/tileset/traversers/i3s-tile-manager.js");
  
  
  
  
  
  
  
  class I3STilesetTraverser extends _tileset_traverser__WEBPACK_IMPORTED_MODULE_1__["default"] {
    constructor(options) {
      super(options);
      this._tileManager = new _i3s_tile_manager__WEBPACK_IMPORTED_MODULE_4__["default"]();
    }
  
    shouldRefine(tile, frameState) {
      // TODO refactor loaJudge
      tile._lodJudge = Object(_helpers_i3s_lod__WEBPACK_IMPORTED_MODULE_2__["lodJudge"])(tile, frameState);
      return tile._lodJudge === 'DIG';
    }
  
    // eslint-disable-next-line complexity
    updateChildTiles(tile, frameState) {
      const children = tile.header.children || [];
      // children which are already fetched and constructed as Tile3D instances
      const childTiles = tile.children;
      const tileset = tile.tileset;
  
      for (const child of children) {
        // if child tile is not fetched
        const childTile = childTiles && childTiles.find(t => t.id === child.id);
        if (!childTile) {
          const request = () => this._loadTile(child.id, tileset);
          const cachedRequest = this._tileManager.find(child.id);
          if (!cachedRequest) {
            this._tileManager.add(
              request,
              child.id,
              header => this._onTileLoad(header, tile),
              frameState
            );
          } else {
            // update frameNumber since it is still needed in current frame
            this._tileManager.update(child.id, frameState);
          }
        } else if (childTile) {
          // if child tile is fetched and available
          this.updateTile(childTile, frameState);
        }
      }
    }
  
    async _loadTile(nodeId, tileset) {
      const {loader} = tileset;
      const nodeUrl = tileset.getTileUrl(`${tileset.url}/nodes/${nodeId}`);
      // load metadata
      const options = {
        i3s: {
          ...tileset.fetchOptions,
          isHeader: true,
          loadContent: false
        }
      };
      return await Object(_loaders_gl_core__WEBPACK_IMPORTED_MODULE_0__["load"])(nodeUrl, loader, options);
    }
  
    _onTileLoad(header, tile) {
      const basePath = this.options.basePath;
      // after child tile is fetched
      const childTile = new _tile_3d__WEBPACK_IMPORTED_MODULE_3__["default"](tile.tileset, header, tile, basePath);
      tile.children.push(childTile);
      const frameState = this._tileManager.find(childTile.id).frameState;
      this.updateTile(childTile, frameState);
  
      // after tile fetched, resume traversal if still in current update/traversal frame
      if (this._frameNumber === frameState.frameNumber) {
        this.executeTraversal(childTile, frameState);
      }
    }
  }
  
  
  /***/ }),
  
  /***/ "./src/tileset/traversers/tileset-3d-traverser.js":
  /*!********************************************************!*\
    !*** ./src/tileset/traversers/tileset-3d-traverser.js ***!
    \********************************************************/
  /*! exports provided: default */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Tileset3DTraverser; });
  /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../constants */ "./src/constants.js");
  /* harmony import */ var _tileset_traverser__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./tileset-traverser */ "./src/tileset/traversers/tileset-traverser.js");
  // This file is derived from the Cesium code base under Apache 2 license
  // See LICENSE.md and https://github.com/AnalyticalGraphicsInc/cesium/blob/master/LICENSE.md
  
  
  
  
  class Tileset3DTraverser extends _tileset_traverser__WEBPACK_IMPORTED_MODULE_1__["default"] {
    compareDistanceToCamera(a, b) {
      // Sort by farthest child first since this is going on a stack
      return b._distanceToCamera === 0 && a._distanceToCamera === 0
        ? b._centerZDepth - a._centerZDepth
        : b._distanceToCamera - a._distanceToCamera;
    }
  
    updateTileVisibility(tile, frameState) {
      tile.updateVisibility(frameState);
  
      //  Optimization - if none of the tile's children are visible then this tile isn't visible
      if (!tile.isVisibleAndInRequestVolume) {
        return;
      }
  
      const hasChildren = tile.children.length > 0;
      if (tile.hasTilesetContent && hasChildren) {
        // Use the root tile's visibility instead of this tile's visibility.
        // The root tile may be culled by the children bounds optimization in which
        // case this tile should also be culled.
        const firstChild = tile.children[0];
        this.updateTileVisibility(firstChild, frameState);
        tile._visible = firstChild._visible;
        return;
      }
  
      if (this.meetsScreenSpaceErrorEarly(tile, frameState)) {
        tile._visible = false;
        return;
      }
  
      const replace = tile.refine === _constants__WEBPACK_IMPORTED_MODULE_0__["TILE_REFINEMENT"].REPLACE;
      const useOptimization =
        tile._optimChildrenWithinParent === _constants__WEBPACK_IMPORTED_MODULE_0__["TILE3D_OPTIMIZATION_HINT"].USE_OPTIMIZATION;
      if (replace && useOptimization && hasChildren) {
        if (!this.anyChildrenVisible(tile, frameState)) {
          tile._visible = false;
          return;
        }
      }
    }
  
    meetsScreenSpaceErrorEarly(tile, frameState) {
      const {parent} = tile;
      if (!parent || parent.hasTilesetContent || parent.refine !== _constants__WEBPACK_IMPORTED_MODULE_0__["TILE_REFINEMENT"].ADD) {
        return false;
      }
  
      // Use parent's geometric error with child's box to see if the tile already meet the SSE
      return !this.shouldRefine(tile, frameState, true);
    }
  }
  
  
  /***/ }),
  
  /***/ "./src/tileset/traversers/tileset-traverser.js":
  /*!*****************************************************!*\
    !*** ./src/tileset/traversers/tileset-traverser.js ***!
    \*****************************************************/
  /*! exports provided: DEFAULT_OPTIONS, default */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DEFAULT_OPTIONS", function() { return DEFAULT_OPTIONS; });
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return TilesetTraverser; });
  /* harmony import */ var _utils_managed_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../utils/managed-array */ "./src/utils/managed-array.js");
  /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../constants */ "./src/constants.js");
  /* harmony import */ var _loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @loaders.gl/loader-utils */ "../loader-utils/src/index.js");
  
  
  
  
  const DEFAULT_OPTIONS = {
    loadSiblings: false,
    skipLevelOfDetail: false,
    maximumScreenSpaceError: 2
  };
  
  class TilesetTraverser {
    // TODO nested props
    constructor(options) {
      this.options = {...DEFAULT_OPTIONS, ...options};
      // TRAVERSAL
      // temporary storage to hold the traversed tiles during a traversal
      this._traversalStack = new _utils_managed_array__WEBPACK_IMPORTED_MODULE_0__["default"]();
      this._emptyTraversalStack = new _utils_managed_array__WEBPACK_IMPORTED_MODULE_0__["default"]();
  
      // set in every traverse cycle
      this._frameNumber = null;
  
      // fulfill in traverse call
      this.root = null;
  
      // RESULT
      // tiles should be rendered
      this.selectedTiles = {};
      // tiles should be loaded from server
      this.requestedTiles = {};
      // tiles does not have render content
      this.emptyTiles = {};
    }
  
    // tiles should be visible
    traverse(root, frameState, options) {
      this.root = root; // for root screen space error
      this.options = {...this.options, ...options};
  
      // reset result
      this.reset();
  
      // update tile (visibility and expiration)
      this.updateTile(root, frameState);
  
      this._frameNumber = frameState.frameNumber;
      this.executeTraversal(root, frameState);
    }
  
    reset() {
      this.requestedTiles = {};
      this.selectedTiles = {};
      this.emptyTiles = {};
      this._traversalStack.reset();
      this._emptyTraversalStack.reset();
    }
  
    // execute traverse
    // Depth-first traversal that traverses all visible tiles and marks tiles for selection.
    // If skipLevelOfDetail is off then a tile does not refine until all children are loaded.
    // This is the traditional replacement refinement approach and is called the base traversal.
    // Tiles that have a greater screen space error than the base screen space error are part of the base traversal,
    // all other tiles are part of the skip traversal. The skip traversal allows for skipping levels of the tree
    // and rendering children and parent tiles simultaneously.
    /* eslint-disable-next-line complexity, max-statements */
    executeTraversal(root, frameState) {
      // stack to store traversed tiles, only visible tiles should be added to stack
      // visible: visible in the current view frustum
      const stack = this._traversalStack;
  
      stack.push(root);
      while (stack.length > 0) {
        // 1. pop tile
        const tile = stack.pop();
  
        // 2. check if tile needs to be refine, needs refine if a tile's LoD is not sufficient and tile has available children (available content)
        let shouldRefine = false;
        if (this.canTraverse(tile, frameState)) {
          this.updateChildTiles(tile, frameState);
          shouldRefine = this.updateAndPushChildren(tile, frameState, stack);
        }
  
        // 3. decide if should render (select) this tile
        //   - tile does not have render content
        //   - tile has render content and tile is `add` type (pointcloud)
        //   - tile has render content and tile is `replace` type (photogrammetry) and can't refine any further
        const parent = tile.parent;
        const parentRefines = Boolean(!parent || parent._shouldRefine);
        const stoppedRefining = !shouldRefine;
  
        if (!tile.hasRenderContent) {
          this.emptyTiles[tile.id] = tile;
          this.loadTile(tile, frameState);
          if (stoppedRefining) {
            this.selectTile(tile, frameState);
          }
          // additive tiles
        } else if (tile.refine === _constants__WEBPACK_IMPORTED_MODULE_1__["TILE_REFINEMENT"].ADD) {
          // Additive tiles are always loaded and selected
          this.loadTile(tile, frameState);
          this.selectTile(tile, frameState);
  
          // replace tiles
        } else if (tile.refine === _constants__WEBPACK_IMPORTED_MODULE_1__["TILE_REFINEMENT"].REPLACE) {
          // Always load tiles in the base traversal
          // Select tiles that can't refine further
          this.loadTile(tile, frameState);
          if (stoppedRefining) {
            this.selectTile(tile, frameState);
          }
        }
  
        // 3. update cache, most recent touched tiles have higher priority to be fetched from server
        this.touchTile(tile, frameState);
  
        // 4. update tile refine prop and parent refinement status to trickle down to the descendants
        tile._shouldRefine = shouldRefine && parentRefines;
      }
  
      if (this.options.onTraversalEnd) {
        this.options.onTraversalEnd(frameState);
      }
    }
  
    updateChildTiles(tile, frameState) {
      const children = tile.children;
      for (const child of children) {
        this.updateTile(child, frameState);
      }
      return true;
    }
  
    /* eslint-disable complexity, max-statements */
    updateAndPushChildren(tile, frameState, stack) {
      const {loadSiblings, skipLevelOfDetail} = this.options;
  
      const children = tile.children;
  
      // sort children tiles
      children.sort(this.compareDistanceToCamera);
  
      // For traditional replacement refinement only refine if all children are loaded.
      // Empty tiles are exempt since it looks better if children stream in as they are loaded to fill the empty space.
      const checkRefines =
        !skipLevelOfDetail && tile.refine === _constants__WEBPACK_IMPORTED_MODULE_1__["TILE_REFINEMENT"].REPLACE && tile.hasRenderContent;
  
      let hasVisibleChild = false;
      for (const child of children) {
        if (child.isVisibleAndInRequestVolume) {
          if (stack.find(child)) {
            stack.delete(child);
          }
          stack.push(child);
          hasVisibleChild = true;
        } else if (checkRefines || loadSiblings) {
          // Keep non-visible children loaded since they are still needed before the parent can refine.
          // Or loadSiblings is true so always load tiles regardless of visibility.
          this.loadTile(child, frameState);
          this.touchTile(child, frameState);
        }
  
        if (checkRefines) {
          let childRefines;
          if (!child._inRequestVolume) {
            childRefines = false;
          } else if (!child.hasRenderContent) {
            childRefines = this.executeEmptyTraversal(child, frameState);
          } else {
            childRefines = child.contentAvailable;
          }
  
          if (!childRefines) {
            return childRefines;
          }
        }
      }
  
      return hasVisibleChild;
    }
    /* eslint-enable complexity, max-statements */
  
    updateTile(tile, frameState) {
      this.updateTileVisibility(tile, frameState);
    }
  
    // tile to render in the browser
    selectTile(tile, frameState) {
      if (this.shouldSelectTile(tile, frameState)) {
        // The tile can be selected right away and does not require traverseAndSelect
        tile._selectedFrame = frameState.frameNumber;
        this.selectedTiles[tile.id] = tile;
      }
    }
  
    // tile to load from server
    loadTile(tile, frameState) {
      if (this.shouldLoadTile(tile, frameState)) {
        tile._requestedFrame = frameState.frameNumber;
        tile._priority = this.getPriority(tile);
        this.requestedTiles[tile.id] = tile;
      }
    }
  
    // cache tile
    touchTile(tile, frameState) {
      tile.tileset._cache.touch(tile);
      tile._touchedFrame = frameState.frameNumber;
    }
  
    // tile should be visible
    // tile should have children
    // tile LoD (level of detail) is not sufficient under current viewport
    canTraverse(tile, frameState, useParentMetric = false, ignoreVisibility = false) {
      if (!ignoreVisibility && !tile.isVisibleAndInRequestVolume) {
        return false;
      }
  
      if (!tile.hasChildren) {
        return false;
      }
  
      // cesium specific
      if (tile.hasTilesetContent) {
        // Traverse external this to visit its root tile
        // Don't traverse if the subtree is expired because it will be destroyed
        return !tile.contentExpired;
      }
  
      return this.shouldRefine(tile, frameState, useParentMetric);
    }
  
    shouldLoadTile(tile, frameState) {
      // if request tile is in current frame
      // and has unexpired render content
      return tile.hasUnloadedContent || tile.contentExpired;
    }
  
    shouldSelectTile(tile, frameState) {
      // if select tile is in current frame
      // and content available
      return tile.contentAvailable && !this.options.skipLevelOfDetail;
    }
  
    // Decide if tile LoD (level of detail) is not sufficient under current viewport
    shouldRefine(tile, frameState, useParentMetric) {
      let screenSpaceError = tile._screenSpaceError;
      if (useParentMetric) {
        screenSpaceError = tile.getScreenSpaceError(frameState, true);
      }
  
      return screenSpaceError > this.options.maximumScreenSpaceError;
    }
  
    updateTileVisibility(tile, frameState) {
      tile.updateVisibility(frameState);
    }
  
    // UTILITIES
  
    compareDistanceToCamera(b, a) {
      return b._distanceToCamera - a._distanceToCamera;
    }
  
    // If skipLevelOfDetail is off try to load child tiles as soon as possible so that their parent can refine sooner.
    // Additive tiles are prioritized by distance because it subjectively looks better.
    // Replacement tiles are prioritized by screen space error.
    // A tileset that has both additive and replacement tiles may not prioritize tiles as effectively since SSE and distance
    // are different types of values. Maybe all priorities need to be normalized to 0-1 range.
    // TODO move to tile-3d-header
    getPriority(tile) {
      const {options} = this;
      switch (tile.refine) {
        case _constants__WEBPACK_IMPORTED_MODULE_1__["TILE_REFINEMENT"].ADD:
          return tile._distanceToCamera;
  
        case _constants__WEBPACK_IMPORTED_MODULE_1__["TILE_REFINEMENT"].REPLACE:
          const {parent} = tile;
          const useParentScreenSpaceError =
            parent &&
            (!options.skipLevelOfDetail ||
              tile._screenSpaceError === 0.0 ||
              parent.hasTilesetContent);
          const screenSpaceError = useParentScreenSpaceError
            ? parent._screenSpaceError
            : tile._screenSpaceError;
          const rootScreenSpaceError = this.root._screenSpaceError;
          return rootScreenSpaceError - screenSpaceError; // Map higher SSE to lower values (e.g. root tile is highest priority)
  
        default:
          return Object(_loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_2__["assert"])(false);
      }
    }
  
    anyChildrenVisible(tile, frameState) {
      let anyVisible = false;
      for (const child of tile.children) {
        child.updateVisibility(frameState);
        anyVisible = anyVisible || child.isVisibleAndInRequestVolume;
      }
      return anyVisible;
    }
  
    // TODO revisit this empty traversal logic
    // Depth-first traversal that checks if all nearest descendants with content are loaded.
    // Ignores visibility.
    executeEmptyTraversal(root, frameState) {
      let allDescendantsLoaded = true;
      const stack = this._emptyTraversalStack;
  
      while (stack.length > 0) {
        const tile = stack.pop();
  
        this.updateTile(tile, frameState);
  
        if (!tile.isVisibleAndInRequestVolume) {
          // Load tiles that aren't visible since they are still needed for the parent to refine
          this.loadTile(tile, frameState);
          this.touchTile(tile, frameState);
        }
  
        // Only traverse if the tile is empty - traversal stop at descendants with content
        const traverse = !tile.hasRenderContent && this.canTraverse(tile, frameState, false, true);
  
        // Traversal stops but the tile does not have content yet.
        // There will be holes if the parent tries to refine to its children, so don't refine.
        if (!traverse && !tile.contentAvailable) {
          allDescendantsLoaded = false;
        }
  
        if (traverse) {
          const children = tile.children.filter(c => c);
          for (const child of children) {
            // eslint-disable-next-line max-depth
            if (stack.find(child)) {
              stack.delete(child);
            }
            stack.push(child);
          }
        }
      }
  
      return allDescendantsLoaded;
    }
  }
  
  // TODO
  // enable expiration
  // enable optimization hint
  
  
  /***/ }),
  
  /***/ "./src/utils/doubly-linked-list-node.js":
  /*!**********************************************!*\
    !*** ./src/utils/doubly-linked-list-node.js ***!
    \**********************************************/
  /*! exports provided: default */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DoublyLinkedListNode; });
  // This file is derived from the Cesium code base under Apache 2 license
  // See LICENSE.md and https://github.com/AnalyticalGraphicsInc/cesium/blob/master/LICENSE.md
  
  /**
   * Doubly linked list node
   *
   * @private
   */
  class DoublyLinkedListNode {
    constructor(item, previous, next) {
      this.item = item;
      this.previous = previous;
      this.next = next;
    }
  }
  
  
  /***/ }),
  
  /***/ "./src/utils/doubly-linked-list.js":
  /*!*****************************************!*\
    !*** ./src/utils/doubly-linked-list.js ***!
    \*****************************************/
  /*! exports provided: default */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DoublyLinkedList; });
  /* harmony import */ var _utils_doubly_linked_list_node__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/doubly-linked-list-node */ "./src/utils/doubly-linked-list-node.js");
  // This file is derived from the Cesium code base under Apache 2 license
  // See LICENSE.md and https://github.com/AnalyticalGraphicsInc/cesium/blob/master/LICENSE.md
  
  
  
  /**
   * Doubly linked list
   *
   * @private
   */
  class DoublyLinkedList {
    constructor() {
      this.head = null;
      this.tail = null;
      this._length = 0;
    }
  
    get length() {
      return this._length;
    }
  
    /**
     * Adds the item to the end of the list
     * @param {*} [item]
     * @return {DoublyLinkedListNode}
     */
    add(item) {
      const node = new _utils_doubly_linked_list_node__WEBPACK_IMPORTED_MODULE_0__["default"](item, this.tail, null);
  
      if (this.tail) {
        this.tail.next = node;
        this.tail = node;
      } else {
        this.head = node;
        this.tail = node;
      }
  
      ++this._length;
  
      return node;
    }
  
    /**
     * Removes the given node from the list
     * @param {DoublyLinkedListNode} node
     */
    remove(node) {
      if (!node) {
        return;
      }
  
      if (node.previous && node.next) {
        node.previous.next = node.next;
        node.next.previous = node.previous;
      } else if (node.previous) {
        // Remove last node
        node.previous.next = null;
        this.tail = node.previous;
      } else if (node.next) {
        // Remove first node
        node.next.previous = null;
        this.head = node.next;
      } else {
        // Remove last node in the linked list
        this.head = null;
        this.tail = null;
      }
  
      node.next = null;
      node.previous = null;
  
      --this._length;
    }
  
    /**
     * Moves nextNode after node
     * @param {DoublyLinkedListNode} node
     * @param {DoublyLinkedListNode} nextNode
     */
    splice(node, nextNode) {
      if (node === nextNode) {
        return;
      }
  
      // Remove nextNode, then insert after node
      this.remove(nextNode);
      this._insert(node, nextNode);
    }
  
    _insert(node, nextNode) {
      const oldNodeNext = node.next;
      node.next = nextNode;
  
      // nextNode is the new tail
      if (this.tail === node) {
        this.tail = nextNode;
      } else {
        oldNodeNext.previous = nextNode;
      }
  
      nextNode.next = oldNodeNext;
      nextNode.previous = node;
  
      ++this._length;
    }
  }
  
  
  /***/ }),
  
  /***/ "./src/utils/managed-array.js":
  /*!************************************!*\
    !*** ./src/utils/managed-array.js ***!
    \************************************/
  /*! exports provided: default */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ManagedArray; });
  /* harmony import */ var _loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @loaders.gl/loader-utils */ "../loader-utils/src/index.js");
  // This file is derived from the Cesium code base under Apache 2 license
  // See LICENSE.md and https://github.com/AnalyticalGraphicsInc/cesium/blob/master/LICENSE.md
  
  
  
  /**
   * A wrapper around arrays so that the internal length of the array can be manually managed.
   *
   * @alias ManagedArray
   * @constructor
   * @private
   *
   * @param {Number} [length=0] The initial length of the array.
   */
  class ManagedArray {
    constructor(length = 0) {
      this._array = new Array(length);
      this._map = new Map();
      this._length = length;
    }
  
    /**
     * Gets or sets the length of the array.
     * If the set length is greater than the length of the internal array, the internal array is resized.
     *
     * @memberof ManagedArray.prototype
     * @type Number
     */
    get length() {
      return this._length;
    }
  
    set length(length) {
      this._length = length;
      if (length > this._array.length) {
        this._array.length = length;
      }
    }
  
    /**
     * Gets the internal array.
     *
     * @memberof ManagedArray.prototype
     * @type Array
     * @readonly
     */
    get values() {
      return this._array;
    }
  
    /**
     * Gets the element at an index.
     *
     * @param {Number} index The index to get.
     */
    get(index) {
      Object(_loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_0__["assert"])(index < this._array.length);
      return this._array[index];
    }
  
    /**
     * Sets the element at an index. Resizes the array if index is greater than the length of the array.
     *
     * @param {Number} index The index to set.
     * @param {*} element The element to set at index.
     */
    set(index, element) {
      Object(_loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_0__["assert"])(index >= 0);
  
      if (index >= this.length) {
        this.length = index + 1;
      }
  
      if (this._map.has(this._array[index])) {
        this._map.delete(this._array[index]);
      }
  
      this._array[index] = element;
      this._map.set(element, index);
    }
  
    delete(element) {
      const index = this._map.get(element);
      if (index >= 0) {
        this._array.splice(index, 1);
        this._map.delete(element);
        this.length--;
      }
    }
  
    /**
     * Returns the last element in the array without modifying the array.
     *
     * @returns {*} The last element in the array.
     */
    peek() {
      return this._array[this._length - 1];
    }
  
    /**
     * Push an element into the array.
     *
     * @param {*} element The element to push.
     */
    push(element) {
      if (!this._map.has(element)) {
        const index = this.length++;
        this._array[index] = element;
        this._map.set(element, index);
      }
    }
  
    /**
     * Pop an element from the array.
     *
     * @returns {*} The last element in the array.
     */
    pop() {
      const element = this._array[--this.length];
      this._map.delete(element);
      return element;
    }
  
    /**
     * Resize the internal array if length > _array.length.
     *
     * @param {Number} length The length.
     */
    reserve(length) {
      Object(_loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_0__["assert"])(length >= 0);
  
      if (length > this._array.length) {
        this._array.length = length;
      }
    }
  
    /**
     * Resize the array.
     *
     * @param {Number} length The length.
     */
    resize(length) {
      Object(_loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_0__["assert"])(length >= 0);
  
      this.length = length;
    }
  
    /**
     * Trim the internal array to the specified length. Defaults to the current length.
     *
     * @param {Number} [length] The length.
     */
    trim(length) {
      if (length === null || length === undefined) {
        length = this.length;
      }
      this._array.length = length;
    }
  
    reset() {
      this._array = [];
      this._map = new Map();
      this._length = 0;
    }
  
    find(target) {
      return this._map.has(target);
    }
  }
  
  
  /***/ }),
  
  /***/ 0:
  /*!**************************************!*\
    !*** ./require-utils.node (ignored) ***!
    \**************************************/
  /*! no static exports found */
  /***/ (function(module, exports) {
  
  /* (ignored) */
  
  /***/ }),
  
  /***/ 1:
  /*!************************************************!*\
    !*** ../../node/read-file-sync.node (ignored) ***!
    \************************************************/
  /*! no static exports found */
  /***/ (function(module, exports) {
  
  /* (ignored) */
  
  /***/ }),
  
  /***/ 2:
  /*!********************************************!*\
    !*** ../../node/write-file.node (ignored) ***!
    \********************************************/
  /*! no static exports found */
  /***/ (function(module, exports) {
  
  /* (ignored) */
  
  /***/ }),
  
  /***/ 3:
  /*!****************************************************!*\
    !*** ../node/utils/to-array-buffer.node (ignored) ***!
    \****************************************************/
  /*! no static exports found */
  /***/ (function(module, exports) {
  
  /* (ignored) */
  
  /***/ })
  
  /******/ });
  });