UNPKG

@luma.gl/gltools

Version:

WebGL2 API Polyfills for WebGL1 WebGLRenderingContext

1,247 lines (987 loc) 187 kB
(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/defineProperty.js": /*!*********************************************************************************************!*\ !*** /Users/missx/Source/luma.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/@probe.gl/env/dist/esm/index.js": /*!********************************************************************************!*\ !*** /Users/missx/Source/luma.gl/node_modules/@probe.gl/env/dist/esm/index.js ***! \********************************************************************************/ /*! exports provided: VERSION, self, window, global, document, process, console, isBrowser, isBrowserMainThread, getBrowser, isMobile, isElectron, assert */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _utils_globals__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils/globals */ "../../node_modules/@probe.gl/env/dist/esm/utils/globals.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VERSION", function() { return _utils_globals__WEBPACK_IMPORTED_MODULE_0__["VERSION"]; }); /* harmony import */ var _lib_globals__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./lib/globals */ "../../node_modules/@probe.gl/env/dist/esm/lib/globals.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "self", function() { return _lib_globals__WEBPACK_IMPORTED_MODULE_1__["self"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "window", function() { return _lib_globals__WEBPACK_IMPORTED_MODULE_1__["window"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "global", function() { return _lib_globals__WEBPACK_IMPORTED_MODULE_1__["global"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "document", function() { return _lib_globals__WEBPACK_IMPORTED_MODULE_1__["document"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "process", function() { return _lib_globals__WEBPACK_IMPORTED_MODULE_1__["process"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "console", function() { return _lib_globals__WEBPACK_IMPORTED_MODULE_1__["console"]; }); /* harmony import */ var _lib_is_browser__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./lib/is-browser */ "../../node_modules/@probe.gl/env/dist/esm/lib/is-browser.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isBrowser", function() { return _lib_is_browser__WEBPACK_IMPORTED_MODULE_2__["default"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isBrowserMainThread", function() { return _lib_is_browser__WEBPACK_IMPORTED_MODULE_2__["isBrowserMainThread"]; }); /* harmony import */ var _lib_get_browser__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./lib/get-browser */ "../../node_modules/@probe.gl/env/dist/esm/lib/get-browser.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getBrowser", function() { return _lib_get_browser__WEBPACK_IMPORTED_MODULE_3__["default"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isMobile", function() { return _lib_get_browser__WEBPACK_IMPORTED_MODULE_3__["isMobile"]; }); /* harmony import */ var _lib_is_electron__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./lib/is-electron */ "../../node_modules/@probe.gl/env/dist/esm/lib/is-electron.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isElectron", function() { return _lib_is_electron__WEBPACK_IMPORTED_MODULE_4__["default"]; }); /* harmony import */ var _utils_assert__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils/assert */ "../../node_modules/@probe.gl/env/dist/esm/utils/assert.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "assert", function() { return _utils_assert__WEBPACK_IMPORTED_MODULE_5__["default"]; }); //# sourceMappingURL=index.js.map /***/ }), /***/ "../../node_modules/@probe.gl/env/dist/esm/lib/get-browser.js": /*!******************************************************************************************!*\ !*** /Users/missx/Source/luma.gl/node_modules/@probe.gl/env/dist/esm/lib/get-browser.js ***! \******************************************************************************************/ /*! exports provided: isMobile, default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isMobile", function() { return isMobile; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return getBrowser; }); /* harmony import */ var _is_browser__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-browser */ "../../node_modules/@probe.gl/env/dist/esm/lib/is-browser.js"); /* harmony import */ var _is_electron__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-electron */ "../../node_modules/@probe.gl/env/dist/esm/lib/is-electron.js"); const window = globalThis; function isMobile() { return typeof window.orientation !== 'undefined'; } function getBrowser(mockUserAgent) { if (!mockUserAgent && !Object(_is_browser__WEBPACK_IMPORTED_MODULE_0__["default"])()) { return 'Node'; } if (Object(_is_electron__WEBPACK_IMPORTED_MODULE_1__["default"])(mockUserAgent)) { return 'Electron'; } const navigator_ = typeof navigator !== 'undefined' ? navigator : {}; const userAgent = mockUserAgent || navigator_.userAgent || ''; if (userAgent.indexOf('Edge') > -1) { return 'Edge'; } const isMSIE = userAgent.indexOf('MSIE ') !== -1; const isTrident = userAgent.indexOf('Trident/') !== -1; if (isMSIE || isTrident) { return 'IE'; } if (window.chrome) { return 'Chrome'; } if (window.safari) { return 'Safari'; } if (window.mozInnerScreenX) { return 'Firefox'; } return 'Unknown'; } //# sourceMappingURL=get-browser.js.map /***/ }), /***/ "../../node_modules/@probe.gl/env/dist/esm/lib/globals.js": /*!**************************************************************************************!*\ !*** /Users/missx/Source/luma.gl/node_modules/@probe.gl/env/dist/esm/lib/globals.js ***! \**************************************************************************************/ /*! exports provided: self, window, global, document, process, console */ /***/ (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__, "process", function() { return process_; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "console", function() { return console_; }); const globals = { self: typeof self !== 'undefined' && self, window: typeof window !== 'undefined' && window, global: typeof global !== 'undefined' && global, document: typeof document !== 'undefined' && document, process: typeof process === 'object' && process }; const global_ = globalThis; const self_ = globals.self || globals.window || globals.global; const window_ = globals.window || globals.self || globals.global; const document_ = globals.document || {}; const process_ = globals.process || {}; const console_ = console; //# sourceMappingURL=globals.js.map /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ "../../node_modules/webpack/buildin/global.js"), __webpack_require__(/*! ./../../../../../process/browser.js */ "../../node_modules/process/browser.js"))) /***/ }), /***/ "../../node_modules/@probe.gl/env/dist/esm/lib/is-browser.js": /*!*****************************************************************************************!*\ !*** /Users/missx/Source/luma.gl/node_modules/@probe.gl/env/dist/esm/lib/is-browser.js ***! \*****************************************************************************************/ /*! exports provided: default, isBrowserMainThread */ /***/ (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 isBrowser; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isBrowserMainThread", function() { return isBrowserMainThread; }); /* harmony import */ var _is_electron__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-electron */ "../../node_modules/@probe.gl/env/dist/esm/lib/is-electron.js"); function isBrowser() { const isNode = typeof process === 'object' && String(process) === '[object process]' && !process.browser; return !isNode || Object(_is_electron__WEBPACK_IMPORTED_MODULE_0__["default"])(); } function isBrowserMainThread() { return isBrowser() && typeof document !== 'undefined'; } //# sourceMappingURL=is-browser.js.map /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../process/browser.js */ "../../node_modules/process/browser.js"))) /***/ }), /***/ "../../node_modules/@probe.gl/env/dist/esm/lib/is-electron.js": /*!******************************************************************************************!*\ !*** /Users/missx/Source/luma.gl/node_modules/@probe.gl/env/dist/esm/lib/is-electron.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 isElectron; }); function isElectron(mockUserAgent) { if (typeof window !== 'undefined' && typeof window.process === 'object' && window.process.type === 'renderer') { return true; } if (typeof process !== 'undefined' && typeof process.versions === 'object' && Boolean(process.versions.electron)) { return true; } const realUserAgent = typeof navigator === 'object' && typeof navigator.userAgent === 'string' && navigator.userAgent; const userAgent = mockUserAgent || realUserAgent; if (userAgent && userAgent.indexOf('Electron') >= 0) { return true; } return false; } //# sourceMappingURL=is-electron.js.map /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../process/browser.js */ "../../node_modules/process/browser.js"))) /***/ }), /***/ "../../node_modules/@probe.gl/env/dist/esm/utils/assert.js": /*!***************************************************************************************!*\ !*** /Users/missx/Source/luma.gl/node_modules/@probe.gl/env/dist/esm/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; }); function assert(condition, message) { if (!condition) { throw new Error(message || 'Assertion failed'); } } //# sourceMappingURL=assert.js.map /***/ }), /***/ "../../node_modules/@probe.gl/env/dist/esm/utils/globals.js": /*!****************************************************************************************!*\ !*** /Users/missx/Source/luma.gl/node_modules/@probe.gl/env/dist/esm/utils/globals.js ***! \****************************************************************************************/ /*! exports provided: self, window, global, document, process, console, VERSION, isBrowser */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VERSION", function() { return VERSION; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isBrowser", function() { return isBrowser; }); /* harmony import */ var _lib_is_browser__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../lib/is-browser */ "../../node_modules/@probe.gl/env/dist/esm/lib/is-browser.js"); /* harmony import */ var _lib_globals__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../lib/globals */ "../../node_modules/@probe.gl/env/dist/esm/lib/globals.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "self", function() { return _lib_globals__WEBPACK_IMPORTED_MODULE_1__["self"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "window", function() { return _lib_globals__WEBPACK_IMPORTED_MODULE_1__["window"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "global", function() { return _lib_globals__WEBPACK_IMPORTED_MODULE_1__["global"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "document", function() { return _lib_globals__WEBPACK_IMPORTED_MODULE_1__["document"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "process", function() { return _lib_globals__WEBPACK_IMPORTED_MODULE_1__["process"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "console", function() { return _lib_globals__WEBPACK_IMPORTED_MODULE_1__["console"]; }); const VERSION = true ? "8.5.20" : undefined; const isBrowser = Object(_lib_is_browser__WEBPACK_IMPORTED_MODULE_0__["default"])(); //# sourceMappingURL=globals.js.map /***/ }), /***/ "../../node_modules/@probe.gl/log/dist/esm/index.js": /*!********************************************************************************!*\ !*** /Users/missx/Source/luma.gl/node_modules/@probe.gl/log/dist/esm/index.js ***! \********************************************************************************/ /*! exports provided: default, Log, COLOR, addColor, leftPad, rightPad, autobind, LocalStorage, getHiResTimestamp */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _log__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./log */ "../../node_modules/@probe.gl/log/dist/esm/log.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Log", function() { return _log__WEBPACK_IMPORTED_MODULE_0__["default"]; }); /* harmony import */ var _utils_color__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils/color */ "../../node_modules/@probe.gl/log/dist/esm/utils/color.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "COLOR", function() { return _utils_color__WEBPACK_IMPORTED_MODULE_1__["COLOR"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addColor", function() { return _utils_color__WEBPACK_IMPORTED_MODULE_1__["addColor"]; }); /* harmony import */ var _utils_formatters__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils/formatters */ "../../node_modules/@probe.gl/log/dist/esm/utils/formatters.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "leftPad", function() { return _utils_formatters__WEBPACK_IMPORTED_MODULE_2__["leftPad"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "rightPad", function() { return _utils_formatters__WEBPACK_IMPORTED_MODULE_2__["rightPad"]; }); /* harmony import */ var _utils_autobind__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils/autobind */ "../../node_modules/@probe.gl/log/dist/esm/utils/autobind.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "autobind", function() { return _utils_autobind__WEBPACK_IMPORTED_MODULE_3__["autobind"]; }); /* harmony import */ var _utils_local_storage__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils/local-storage */ "../../node_modules/@probe.gl/log/dist/esm/utils/local-storage.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "LocalStorage", function() { return _utils_local_storage__WEBPACK_IMPORTED_MODULE_4__["default"]; }); /* harmony import */ var _utils_hi_res_timestamp__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils/hi-res-timestamp */ "../../node_modules/@probe.gl/log/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_5__["getHiResTimestamp"]; }); /* harmony import */ var _init__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./init */ "../../node_modules/@probe.gl/log/dist/esm/init.js"); /* harmony import */ var _init__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_init__WEBPACK_IMPORTED_MODULE_6__); /* harmony default export */ __webpack_exports__["default"] = (new _log__WEBPACK_IMPORTED_MODULE_0__["default"]({ id: '@probe.gl/log' })); //# sourceMappingURL=index.js.map /***/ }), /***/ "../../node_modules/@probe.gl/log/dist/esm/init.js": /*!*******************************************************************************!*\ !*** /Users/missx/Source/luma.gl/node_modules/@probe.gl/log/dist/esm/init.js ***! \*******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { globalThis.probe = {}; //# sourceMappingURL=init.js.map /***/ }), /***/ "../../node_modules/@probe.gl/log/dist/esm/log.js": /*!******************************************************************************!*\ !*** /Users/missx/Source/luma.gl/node_modules/@probe.gl/log/dist/esm/log.js ***! \******************************************************************************/ /*! exports provided: default, normalizeArguments */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Log; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalizeArguments", function() { return normalizeArguments; }); /* 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 _probe_gl_env__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @probe.gl/env */ "../../node_modules/@probe.gl/env/dist/esm/index.js"); /* harmony import */ var _utils_local_storage__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils/local-storage */ "../../node_modules/@probe.gl/log/dist/esm/utils/local-storage.js"); /* harmony import */ var _utils_formatters__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils/formatters */ "../../node_modules/@probe.gl/log/dist/esm/utils/formatters.js"); /* harmony import */ var _utils_color__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils/color */ "../../node_modules/@probe.gl/log/dist/esm/utils/color.js"); /* harmony import */ var _utils_autobind__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils/autobind */ "../../node_modules/@probe.gl/log/dist/esm/utils/autobind.js"); /* harmony import */ var _utils_assert__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./utils/assert */ "../../node_modules/@probe.gl/log/dist/esm/utils/assert.js"); /* harmony import */ var _utils_hi_res_timestamp__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./utils/hi-res-timestamp */ "../../node_modules/@probe.gl/log/dist/esm/utils/hi-res-timestamp.js"); const originalConsole = { debug: _probe_gl_env__WEBPACK_IMPORTED_MODULE_1__["isBrowser"] ? console.debug || console.log : console.log, log: console.log, info: console.info, warn: console.warn, error: console.error }; const DEFAULT_SETTINGS = { enabled: true, level: 0 }; function noop() {} const cache = {}; const ONCE = { once: true }; class Log { constructor() { let { id } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { id: '' }; Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "id", void 0); Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "VERSION", _probe_gl_env__WEBPACK_IMPORTED_MODULE_1__["VERSION"]); Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_startTs", Object(_utils_hi_res_timestamp__WEBPACK_IMPORTED_MODULE_7__["getHiResTimestamp"])()); Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_deltaTs", Object(_utils_hi_res_timestamp__WEBPACK_IMPORTED_MODULE_7__["getHiResTimestamp"])()); Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_storage", void 0); Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "userData", {}); Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "LOG_THROTTLE_TIMEOUT", 0); this.id = id; this._storage = new _utils_local_storage__WEBPACK_IMPORTED_MODULE_2__["default"]("__probe-".concat(this.id, "__"), DEFAULT_SETTINGS); this.userData = {}; this.timeStamp("".concat(this.id, " started")); Object(_utils_autobind__WEBPACK_IMPORTED_MODULE_5__["autobind"])(this); Object.seal(this); } set level(newLevel) { this.setLevel(newLevel); } get level() { return this.getLevel(); } isEnabled() { return this._storage.config.enabled; } getLevel() { return this._storage.config.level; } getTotal() { return Number((Object(_utils_hi_res_timestamp__WEBPACK_IMPORTED_MODULE_7__["getHiResTimestamp"])() - this._startTs).toPrecision(10)); } getDelta() { return Number((Object(_utils_hi_res_timestamp__WEBPACK_IMPORTED_MODULE_7__["getHiResTimestamp"])() - this._deltaTs).toPrecision(10)); } set priority(newPriority) { this.level = newPriority; } get priority() { return this.level; } getPriority() { return this.level; } enable() { let enabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; this._storage.updateConfiguration({ enabled }); return this; } setLevel(level) { this._storage.updateConfiguration({ level }); return this; } get(setting) { return this._storage.config[setting]; } set(setting, value) { this._storage.updateConfiguration({ [setting]: value }); } settings() { if (console.table) { console.table(this._storage.config); } else { console.log(this._storage.config); } } assert(condition, message) { Object(_utils_assert__WEBPACK_IMPORTED_MODULE_6__["default"])(condition, message); } warn(message) { return this._getLogFunction(0, message, originalConsole.warn, arguments, ONCE); } error(message) { return this._getLogFunction(0, message, originalConsole.error, arguments); } deprecated(oldUsage, newUsage) { return this.warn("`".concat(oldUsage, "` is deprecated and will be removed in a later version. Use `").concat(newUsage, "` instead")); } removed(oldUsage, newUsage) { return this.error("`".concat(oldUsage, "` has been removed. Use `").concat(newUsage, "` instead")); } probe(logLevel, message) { return this._getLogFunction(logLevel, message, originalConsole.log, arguments, { time: true, once: true }); } log(logLevel, message) { return this._getLogFunction(logLevel, message, originalConsole.debug, arguments); } info(logLevel, message) { return this._getLogFunction(logLevel, message, console.info, arguments); } once(logLevel, message) { for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { args[_key - 2] = arguments[_key]; } return this._getLogFunction(logLevel, message, originalConsole.debug || originalConsole.info, arguments, ONCE); } table(logLevel, table, columns) { if (table) { return this._getLogFunction(logLevel, table, console.table || noop, columns && [columns], { tag: getTableHeader(table) }); } return noop; } image(_ref) { let { logLevel, priority, image, message = '', scale = 1 } = _ref; if (!this._shouldLog(logLevel || priority)) { return noop; } return _probe_gl_env__WEBPACK_IMPORTED_MODULE_1__["isBrowser"] ? logImageInBrowser({ image, message, scale }) : logImageInNode({ image, message, scale }); } time(logLevel, message) { return this._getLogFunction(logLevel, message, console.time ? console.time : console.info); } timeEnd(logLevel, message) { return this._getLogFunction(logLevel, message, console.timeEnd ? console.timeEnd : console.info); } timeStamp(logLevel, message) { return this._getLogFunction(logLevel, message, console.timeStamp || noop); } group(logLevel, message) { let opts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : { collapsed: false }; const options = normalizeArguments({ logLevel, message, opts }); const { collapsed } = opts; options.method = (collapsed ? console.groupCollapsed : console.group) || console.info; return this._getLogFunction(options); } groupCollapsed(logLevel, message) { let opts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; return this.group(logLevel, message, Object.assign({}, opts, { collapsed: true })); } groupEnd(logLevel) { return this._getLogFunction(logLevel, '', console.groupEnd || noop); } withGroup(logLevel, message, func) { this.group(logLevel, message)(); try { func(); } finally { this.groupEnd(logLevel)(); } } trace() { if (console.trace) { console.trace(); } } _shouldLog(logLevel) { return this.isEnabled() && this.getLevel() >= normalizeLogLevel(logLevel); } _getLogFunction(logLevel, message, method, args, opts) { if (this._shouldLog(logLevel)) { opts = normalizeArguments({ logLevel, message, args, opts }); method = method || opts.method; Object(_utils_assert__WEBPACK_IMPORTED_MODULE_6__["default"])(method); opts.total = this.getTotal(); opts.delta = this.getDelta(); this._deltaTs = Object(_utils_hi_res_timestamp__WEBPACK_IMPORTED_MODULE_7__["getHiResTimestamp"])(); const tag = opts.tag || opts.message; if (opts.once) { if (!cache[tag]) { cache[tag] = Object(_utils_hi_res_timestamp__WEBPACK_IMPORTED_MODULE_7__["getHiResTimestamp"])(); } else { return noop; } } message = decorateMessage(this.id, opts.message, opts); return method.bind(console, message, ...opts.args); } return noop; } } Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(Log, "VERSION", _probe_gl_env__WEBPACK_IMPORTED_MODULE_1__["VERSION"]); function normalizeLogLevel(logLevel) { if (!logLevel) { return 0; } let resolvedLevel; switch (typeof logLevel) { case 'number': resolvedLevel = logLevel; break; case 'object': resolvedLevel = logLevel.logLevel || logLevel.priority || 0; break; default: return 0; } Object(_utils_assert__WEBPACK_IMPORTED_MODULE_6__["default"])(Number.isFinite(resolvedLevel) && resolvedLevel >= 0); return resolvedLevel; } function normalizeArguments(opts) { const { logLevel, message } = opts; opts.logLevel = normalizeLogLevel(logLevel); const args = opts.args ? Array.from(opts.args) : []; while (args.length && args.shift() !== message) {} switch (typeof logLevel) { case 'string': case 'function': if (message !== undefined) { args.unshift(message); } opts.message = logLevel; break; case 'object': Object.assign(opts, logLevel); break; default: } if (typeof opts.message === 'function') { opts.message = opts.message(); } const messageType = typeof opts.message; Object(_utils_assert__WEBPACK_IMPORTED_MODULE_6__["default"])(messageType === 'string' || messageType === 'object'); return Object.assign(opts, { args }, opts.opts); } function decorateMessage(id, message, opts) { if (typeof message === 'string') { const time = opts.time ? Object(_utils_formatters__WEBPACK_IMPORTED_MODULE_3__["leftPad"])(Object(_utils_formatters__WEBPACK_IMPORTED_MODULE_3__["formatTime"])(opts.total)) : ''; message = opts.time ? "".concat(id, ": ").concat(time, " ").concat(message) : "".concat(id, ": ").concat(message); message = Object(_utils_color__WEBPACK_IMPORTED_MODULE_4__["addColor"])(message, opts.color, opts.background); } return message; } function logImageInNode(_ref2) { let { image, message = '', scale = 1 } = _ref2; let asciify = null; try { asciify = __webpack_require__(/*! asciify-image */ 0); } catch (error) {} if (asciify) { return () => asciify(image, { fit: 'box', width: "".concat(Math.round(80 * scale), "%") }).then(data => console.log(data)); } return noop; } function logImageInBrowser(_ref3) { let { image, message = '', scale = 1 } = _ref3; if (typeof image === 'string') { const img = new Image(); img.onload = () => { const args = Object(_utils_formatters__WEBPACK_IMPORTED_MODULE_3__["formatImage"])(img, message, scale); console.log(...args); }; img.src = image; return noop; } const element = image.nodeName || ''; if (element.toLowerCase() === 'img') { console.log(...Object(_utils_formatters__WEBPACK_IMPORTED_MODULE_3__["formatImage"])(image, message, scale)); return noop; } if (element.toLowerCase() === 'canvas') { const img = new Image(); img.onload = () => console.log(...Object(_utils_formatters__WEBPACK_IMPORTED_MODULE_3__["formatImage"])(img, message, scale)); img.src = image.toDataURL(); return noop; } return noop; } function getTableHeader(table) { for (const key in table) { for (const title in table[key]) { return title || 'untitled'; } } return 'empty'; } //# sourceMappingURL=log.js.map /***/ }), /***/ "../../node_modules/@probe.gl/log/dist/esm/utils/assert.js": /*!***************************************************************************************!*\ !*** /Users/missx/Source/luma.gl/node_modules/@probe.gl/log/dist/esm/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; }); function assert(condition, message) { if (!condition) { throw new Error(message || 'Assertion failed'); } } //# sourceMappingURL=assert.js.map /***/ }), /***/ "../../node_modules/@probe.gl/log/dist/esm/utils/autobind.js": /*!*****************************************************************************************!*\ !*** /Users/missx/Source/luma.gl/node_modules/@probe.gl/log/dist/esm/utils/autobind.js ***! \*****************************************************************************************/ /*! exports provided: autobind */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "autobind", function() { return autobind; }); function autobind(obj) { let predefined = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ['constructor']; const proto = Object.getPrototypeOf(obj); const propNames = Object.getOwnPropertyNames(proto); for (const key of propNames) { if (typeof obj[key] === 'function') { if (!predefined.find(name => key === name)) { obj[key] = obj[key].bind(obj); } } } } //# sourceMappingURL=autobind.js.map /***/ }), /***/ "../../node_modules/@probe.gl/log/dist/esm/utils/color.js": /*!**************************************************************************************!*\ !*** /Users/missx/Source/luma.gl/node_modules/@probe.gl/log/dist/esm/utils/color.js ***! \**************************************************************************************/ /*! exports provided: COLOR, addColor */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "COLOR", function() { return COLOR; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addColor", function() { return addColor; }); /* harmony import */ var _probe_gl_env__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @probe.gl/env */ "../../node_modules/@probe.gl/env/dist/esm/index.js"); let COLOR; (function (COLOR) { COLOR[COLOR["BLACK"] = 30] = "BLACK"; COLOR[COLOR["RED"] = 31] = "RED"; COLOR[COLOR["GREEN"] = 32] = "GREEN"; COLOR[COLOR["YELLOW"] = 33] = "YELLOW"; COLOR[COLOR["BLUE"] = 34] = "BLUE"; COLOR[COLOR["MAGENTA"] = 35] = "MAGENTA"; COLOR[COLOR["CYAN"] = 36] = "CYAN"; COLOR[COLOR["WHITE"] = 37] = "WHITE"; COLOR[COLOR["BRIGHT_BLACK"] = 90] = "BRIGHT_BLACK"; COLOR[COLOR["BRIGHT_RED"] = 91] = "BRIGHT_RED"; COLOR[COLOR["BRIGHT_GREEN"] = 92] = "BRIGHT_GREEN"; COLOR[COLOR["BRIGHT_YELLOW"] = 93] = "BRIGHT_YELLOW"; COLOR[COLOR["BRIGHT_BLUE"] = 94] = "BRIGHT_BLUE"; COLOR[COLOR["BRIGHT_MAGENTA"] = 95] = "BRIGHT_MAGENTA"; COLOR[COLOR["BRIGHT_CYAN"] = 96] = "BRIGHT_CYAN"; COLOR[COLOR["BRIGHT_WHITE"] = 97] = "BRIGHT_WHITE"; })(COLOR || (COLOR = {})); function getColor(color) { return typeof color === 'string' ? COLOR[color.toUpperCase()] || COLOR.WHITE : color; } function addColor(string, color, background) { if (!_probe_gl_env__WEBPACK_IMPORTED_MODULE_0__["isBrowser"] && typeof string === 'string') { if (color) { color = getColor(color); string = "\x1B[".concat(color, "m").concat(string, "\x1B[39m"); } if (background) { color = getColor(background); string = "\x1B[".concat(background + 10, "m").concat(string, "\x1B[49m"); } } return string; } //# sourceMappingURL=color.js.map /***/ }), /***/ "../../node_modules/@probe.gl/log/dist/esm/utils/formatters.js": /*!*******************************************************************************************!*\ !*** /Users/missx/Source/luma.gl/node_modules/@probe.gl/log/dist/esm/utils/formatters.js ***! \*******************************************************************************************/ /*! exports provided: formatTime, leftPad, rightPad, formatValue, formatImage */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "formatTime", function() { return formatTime; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "leftPad", function() { return leftPad; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rightPad", function() { return rightPad; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "formatValue", function() { return formatValue; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "formatImage", function() { return formatImage; }); function formatTime(ms) { let formatted; if (ms < 10) { formatted = "".concat(ms.toFixed(2), "ms"); } else if (ms < 100) { formatted = "".concat(ms.toFixed(1), "ms"); } else if (ms < 1000) { formatted = "".concat(ms.toFixed(0), "ms"); } else { formatted = "".concat((ms / 1000).toFixed(2), "s"); } return formatted; } function leftPad(string) { let length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 8; const padLength = Math.max(length - string.length, 0); return "".concat(' '.repeat(padLength)).concat(string); } function rightPad(string) { let length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 8; const padLength = Math.max(length - string.length, 0); return "".concat(string).concat(' '.repeat(padLength)); } function formatValue(v) { let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; const EPSILON = 1e-16; const { isInteger = false } = opts; if (Array.isArray(v) || ArrayBuffer.isView(v)) { return formatArrayValue(v, opts); } if (!Number.isFinite(v)) { return String(v); } if (Math.abs(v) < EPSILON) { return isInteger ? '0' : '0.'; } if (isInteger) { return v.toFixed(0); } if (Math.abs(v) > 100 && Math.abs(v) < 10000) { return v.toFixed(0); } const string = v.toPrecision(2); const decimal = string.indexOf('.0'); return decimal === string.length - 2 ? string.slice(0, -1) : string; } function formatArrayValue(v, opts) { const { maxElts = 16, size = 1 } = opts; let string = '['; for (let i = 0; i < v.length && i < maxElts; ++i) { if (i > 0) { string += ",".concat(i % size === 0 ? ' ' : ''); } string += formatValue(v[i], opts); } const terminator = v.length > maxElts ? '...' : ']'; return "".concat(string).concat(terminator); } function formatImage(image, message, scale) { let maxWidth = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 600; const imageUrl = image.src.replace(/\(/g, '%28').replace(/\)/g, '%29'); if (image.width > maxWidth) { scale = Math.min(scale, maxWidth / image.width); } const width = image.width * scale; const height = image.height * scale; const style = ['font-size:1px;', "padding:".concat(Math.floor(height / 2), "px ").concat(Math.floor(width / 2), "px;"), "line-height:".concat(height, "px;"), "background:url(".concat(imageUrl, ");"), "background-size:".concat(width, "px ").concat(height, "px;"), 'color:transparent;'].join(''); return ["".concat(message, " %c+"), style]; } //# sourceMappingURL=formatters.js.map /***/ }), /***/ "../../node_modules/@probe.gl/log/dist/esm/utils/hi-res-timestamp.js": /*!*************************************************************************************************!*\ !*** /Users/missx/Source/luma.gl/node_modules/@probe.gl/log/dist/esm/utils/hi-res-timestamp.js ***! \*************************************************************************************************/ /*! exports provided: getHiResTimestamp */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getHiResTimestamp", function() { return getHiResTimestamp; }); /* harmony import */ var _probe_gl_env__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @probe.gl/env */ "../../node_modules/@probe.gl/env/dist/esm/index.js"); function getHiResTimestamp() { let timestamp; if (_probe_gl_env__WEBPACK_IMPORTED_MODULE_0__["isBrowser"] && 'performance' in _probe_gl_env__WEBPACK_IMPORTED_MODULE_0__["window"]) { var _window$performance, _window$performance$n; timestamp = _probe_gl_env__WEBPACK_IMPORTED_MODULE_0__["window"] === null || _probe_gl_env__WEBPACK_IMPORTED_MODULE_0__["window"] === void 0 ? void 0 : (_window$performance = _probe_gl_env__WEBPACK_IMPORTED_MODULE_0__["window"].performance) === null || _window$performance === void 0 ? void 0 : (_window$performance$n = _window$performance.now) === null || _window$performance$n === void 0 ? void 0 : _window$performance$n.call(_window$performance); } else if ('hrtime' in _probe_gl_env__WEBPACK_IMPORTED_MODULE_0__["process"]) { var _process$hrtime; const timeParts = _probe_gl_env__WEBPACK_IMPORTED_MODULE_0__["process"] === null || _probe_gl_env__WEBPACK_IMPORTED_MODULE_0__["process"] === void 0 ? void 0 : (_process$hrtime = _probe_gl_env__WEBPACK_IMPORTED_MODULE_0__["process"].hrtime) === null || _process$hrtime === void 0 ? void 0 : _process$hrtime.call(_probe_gl_env__WEBPACK_IMPORTED_MODULE_0__["process"]); timestamp = timeParts[0] * 1000 + timeParts[1] / 1e6; } else { timestamp = Date.now(); } return timestamp; } //# sourceMappingURL=hi-res-timestamp.js.map /***/ }), /***/ "../../node_modules/@probe.gl/log/dist/esm/utils/local-storage.js": /*!**********************************************************************************************!*\ !*** /Users/missx/Source/luma.gl/node_modules/@probe.gl/log/dist/esm/utils/local-storage.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 LocalStorage; }); /* 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"); function getStorage(type) { try { const storage = window[type]; const x = '__storage_test__'; storage.setItem(x, x); storage.removeItem(x); return storage; } catch (e) { return null; } } class LocalStorage { constructor(id) { let defaultSettings = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; let type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'sessionStorage'; Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "storage", void 0); Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "id", void 0); Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "config", {}); this.storage = getStorage(type); this.id = id; this.config = {}; Object.assign(this.config, defaultSettings); this._loadConfiguration(); } getConfiguration() { return this.config; } setConfiguration(configuration) { this.config = {}; return this.updateConfiguration(configuration); } updateConfiguration(configuration) { Object.assign(this.config, configuration); if (this.storage) { const serialized = JSON.stringify(this.config); this.storage.setItem(this.id, serialized); } return this; } _loadConfiguration() { let configuration = {}; if (this.storage) { const serializedConfiguration = this.storage.getItem(this.id); configuration = serializedConfiguration ? JSON.parse(serializedConfiguration) : {}; } Object.assign(this.config, configuration); return this; } } //# sourceMappingURL=local-storage.js.map /***/ }), /***/ "../../node_modules/process/browser.js": /*!*******************************************************************!*\ !*** /Users/missx/Source/luma.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 defa